[
https://issues.apache.org/jira/browse/ARROW-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16770709#comment-16770709
]
Kenta Murata commented on ARROW-4600:
-------------------------------------
Oh, I'm sorry. The fixed script and the new error message is given below:
{{$ cat test.rb}}
{{require 'arrow'}}{{ary = Arrow::DictionaryArray.new(}}
{{ Arrow::DictionaryDataType.new(:int8, Arrow::StringArray.new(%w[foo bar
baz]), true),}}
{{ Arrow::Int8Array.new([0, 1, 0, 1, 2, 1, 2, 0])}}
{{)}}{{ary[0]}}
{{$ ruby test.rb}}
{{Traceback (most recent call last):}}
{{ 1: from test.rb:8:in `<main>'}}
{{/Users/mrkn/src/github.com/apache/arrow/ruby/red-arrow/lib/arrow/array.rb:53:in
`[]': *undefined method `get_value' for
#<Arrow::DictionaryArray:0x00007f916a1e9620> (+NoMethodError+)*}}
> [Ruby] Arrow::DictionaryArray#[] should returns the item in the indices array
> -----------------------------------------------------------------------------
>
> Key: ARROW-4600
> URL: https://issues.apache.org/jira/browse/ARROW-4600
> Project: Apache Arrow
> Issue Type: Bug
> Components: Ruby
> Reporter: Kenta Murata
> Priority: Major
>
> Arrow::DictionaryArray#[] should returns the item in the indices array.
> However, the current behavior is error like below:
> {{Traceback (most recent call last):}}
> {{ 5: from test.rb:4:in `<main>'}}
> {{ 4: from test.rb:4:in `new'}}
> {{ 3: from
> /Users/mrkn/src/github.com/apache/arrow/ruby/red-arrow/lib/arrow/dictionary-data-type.rb:103:in
> `initialize'}}
> {{ 2: from
> /Users/mrkn/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/gobject-introspection-3.3.1/lib/gobject-introspection/loader.rb:328:in
> `block in load_constructor_infos'}}
> {{ 1: from
> /Users/mrkn/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/gobject-introspection-3.3.1/lib/gobject-introspection/loader.rb:317:in
> `block (2 levels) in load_constructor_infos'}}
>
> {{/Users/mrkn/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/gobject-introspection-3.3.1/lib/gobject-introspection/loader.rb:317:in
> `invoke': *invalid argument Array (expect #<Class:0x00007ff1ad9179a8>)
> (+ArgumentError+)*}}
> test.rb is given below:
> {{require 'arrow'}}
> {{ary = Arrow::DictionaryArray.new(}}
> {{ Arrow::DictionaryDataType.new(:int8, %w[foo bar baz], true),}}
> {{ Arrow::Int8Array.new([0, 1, 0, 1, 2, 1, 2, 0])}}
> {{)}}
> {{ary[0]}}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)