-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-14495: [Python] Fix DictionaryArray.from_buffers, should not crash #13989
ARROW-14495: [Python] Fix DictionaryArray.from_buffers, should not crash #13989
Conversation
|
Requires modifying signature to take dictionary as well as the buffers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
with nogil: | ||
c_data = CArrayData.Make( | ||
c_type, length, c_buffers, null_count, offset) | ||
c_data.get().dictionary = dictionary.sp_array.get().data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a ArrayData::Make
variant that directly accepts a dictionary, but that might not be worth exposing for just this one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that, and it appears to essentially do the same; creating ArrayData
then setting the dictionary member. Using it this way, we don't need to pass (null?) child data, albeit, if that way is the preferred method I have no problem switching. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. Just a minor suggestion.
[skip ci] Co-authored-by: Antoine Pitrou <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
@pitrou I think this is ready for another round. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @milesgranger
…ash (apache#13989) Fix [ARROW-14495](https://issues.apache.org/jira/browse/ARROW-14495) Authored-by: Miles Granger <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
…ash (apache#13989) Fix [ARROW-14495](https://issues.apache.org/jira/browse/ARROW-14495) Authored-by: Miles Granger <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
Fix ARROW-14495