Skip to content
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

[Compute] ArrowNotImplementedError: Function 'multiply' has no kernel matching input types (duration[s], int32) #36128

Closed
randolf-scholz opened this issue Jun 16, 2023 · 2 comments · Fixed by #36231

Comments

@randolf-scholz
Copy link

randolf-scholz commented Jun 16, 2023

Describe the enhancement requested

import pyarrow as pa

arr = pa.array([1,2,3], type=pa.duration("s"))
mul = pa.array([1,2,3], type=pa.int32())

pa.compute.multiply(arr, [1,2,3])  # ✔ works
pa.compute.multiply(arr, mul)  # ✘ ArrowNotImplementedError: Function 'multiply' has no kernel matching input types (duration[s], int32)

Multiplication of duration-type with python int works, but not with pyarrow's int32. It should in priunciple work with any integer type.

Component(s)

Python

@westonpace
Copy link
Member

@js8544 recently fixed something very similar. I don't recall if it would have addressed this issue or not.

@kou kou removed their assignment Jun 21, 2023
@js8544
Copy link
Collaborator

js8544 commented Jun 22, 2023

@js8544 recently fixed something very similar. I don't recall if it would have addressed this issue or not.

Not really, that was for the is_in kernels, but I'll submit a PR for this issue.

pitrou pushed a commit that referenced this issue Jun 26, 2023
…l integer types (#36231)

### Rationale for this change

Currently durations can only be multiplied with int64, but no other integer types.

### What changes are included in this PR?

Allow duration types to be multiplied with any integer type.
1. For `multiply`, new kernels are added to support the new types.
2. For `multiply_checked`, integers will be casted to int64. We can't add new kernels because the MultiplyChecked op class requires both operands to have the same type.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: #36128

Authored-by: Jin Shang <shangjin1997@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
@pitrou pitrou added this to the 13.0.0 milestone Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants