-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-48167: [Python][Compute] Add python bindings for scatter, inverse_permutation #48267
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
base: main
Are you sure you want to change the base?
GH-48167: [Python][Compute] Add python bindings for scatter, inverse_permutation #48267
Conversation
|
|
|
The background of Does it make sense to add Python wrappers/bindings for Currently both |
|
|
1 similar comment
|
|
|
Hi @tadeja , thanks for working on this. Appreciate it. I'm glad to see we are adding python bindings for
I think it does make sense to have them.
I'm not sure what you mean. The underlying C++ APIs will accept those options. So I would expect no problem for their python bindings. Are you saying that they are not working? |
a3b6fb1 to
47e3e8c
Compare
|
Thank you for the input, @zanmato1984, that helped.
It looks like Python bindings got fixed by adding option class names to FunctionDoc in vector_swizzle.cc. Now If See example below: import pyarrow.compute as pc
pc.InversePermutationOptions()
>>> InversePermutationOptions(max_index=-1, output_type=<NULLPTR>)import pyarrow.compute as pc
pc.InversePermutationOptions().serialize()
>>> Traceback (most recent call last):
File "<python-input-3>", line 1, in <module>
pc.InversePermutationOptions().serialize()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "pyarrow/_compute.pyx", line 623, in pyarrow._compute.FunctionOptions.serialize
shared_ptr[CBuffer] c_buf = GetResultValue(res)
File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
return check_status(status)
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
raise convert_status(status)
pyarrow.lib.ArrowInvalid: Could not serialize field output_type of options type InversePermutationOptions: shared_ptr<DataType> is nullptrcc @pitrou |
|
Thanks @tadeja for the further explanation! I now see the problem. Let me check the code and get back to you soon. |
Rationale for this change
To close or discuss #48167
inverse_permutationandscatterfunctions got implemented via #44393, PR #44394.What changes are included in this PR?
Python tests for
scatter,inverse_permutationkernels and bindings forInversePermutationOptionsandScatterOptions.Are these changes tested?
Yes, tests added in test_compute.py.
Are there any user-facing changes?
Bindings for
InversePermutationOptionsandScatterOptionsare added.