Repository navigation
GH-35289: [Python] Support large variable width types in numpy conversion - #36701
Conversation
|
|
|
Thank you for the contribution @Kimahriman ! The PR looks good! In the C++ part, where I am a novice also - but, I would try with creating a helper Status function and see if I can make it work with both builder instances or not (am not really sure it will work). As for the python test, it could also be consolidated with arrow/python/pyarrow/tests/test_array.py Line 635 in 9ecd0f2 |
In the Visit functions, I think the main (only?) difference is the type of |
|
Thanks for the ideas, I'll see if I can figure anything out 😅 |
|
Ok I learned about C++ templates and deduped the different functions, and I just parametrized the existing python test |
AlenkaF
left a comment
There was a problem hiding this comment.
Great work! The PR looks good IMO +1.
@jorisvandenbossche could you give one more look before merging?
|
@jorisvandenbossche gentle ping |
|
@jorisvandenbossche gentle ping again. Merged in master and resolved the conflict |
jorisvandenbossche
left a comment
There was a problem hiding this comment.
Looks good!
And apologies for the very slow follow-up ..
I have one more request: could you add a simple test for this as well (the large_memory test you edited it good to have, but in most our CI builds those are skipped, so it would be good to have a simple small test as well that is run everywhere).
For example there is a test_array_from_numpy_ascii and test_array_from_numpy_unicode. You could add one case to those tests with specifying the type as the large variant.
Parameterized those tests to specify the type and use regular and large types |
|
I can review or pickup next week. @Kimahriman are you interested in continuing this work? |
I was able to get this up to date with main, I don't know much about the view types |
|
Thank you @Kimahriman! Depending on how adventurous you feel we can make a separate PR or add view types here. |
|
Probably would be good to do in a follow on, not sure how quickly I can figure out and get the views working |
|
@Kimahriman agreed! |
|
Nevermind adding the views was pretty simple |
|
|
AlenkaF
left a comment
There was a problem hiding this comment.
Thank you for continuing to work on this PR @Kimahriman, it is much appreciated! And thanks @pitrou for the ping.
The PR LGTM with all the comments addressed. I think you can update the description tiny bit (AppendUTF32 is updated, no copy was needed AFAIU).
|
|
1 similar comment
|
|
|
All the open discussions should be resolved, and I updated the description a bit with the current implementation |
|
@github-actions crossbow submit -g python |
|
Revision: cb479c8 Submitted crossbow builds: ursacomputing/crossbow @ actions-4fe3452fe3 |
rok
left a comment
There was a problem hiding this comment.
Looks great, thanks for doing this @Kimahriman !
|
Thank you for your contribution and patience @Kimahriman ! |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 9752c34. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 13 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
Add support for LargeBinaryType, BinaryViewType, LargeStringType, and StringViewType in NumPy to Arrow conversion.
What changes are included in this PR?
Adds new
Visitmethods inNumPyConverterforLargeStringType,StringViewType,LargeBinaryType, andBinaryViewType. These are built on top of new templatedVisitStringandVisitBinarymethods.Also adds the Arrow -> NumPy type map for the large binary types.
Are these changes tested?
New test added showing a string and binary array over 2 GiB is valid and still a single chunk. Also added the new Arrow to NumPy maps to a schema test.
Are there any user-facing changes?
Adds support for converting NumPy string/binary lists to large binary types.