chaokunyang opened a new issue, #34927:
URL: https://github.com/apache/arrow/issues/34927
### Describe the enhancement requested
Currently arrow compute `utf8_slice_codeunits` doesn't stop/step parameters
with array type. When running following code, it'll raise `TypeError`
```python
import pyarrow as pa
import pyarrow.compute as pc
animals = pa.array(["A11A", "Horse", "Brittle stars", "Centipede"])
pc.utf8_slice_codeunits(animals, start=0, stop=pa.array([1, 2, 3, 4]))
```
Exception:
```
Traceback (most recent call last):
File
"/Users/chaokunyang/anaconda3/envs/py3.8/lib/python3.8/site-packages/IPython/core/interactiveshell.py",
line 3460, in run_code
File
"/var/folders/zz/mnr4zfjn45j2d_vl88bz8hm80000gp/T/ipykernel_13874/31766106.py",
line 1, in <module>
pc.utf8_slice_codeunits(animals, start=0, stop=pa.array([1, 2, 3, 4]))
File
"/Users/chaokunyang/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/compute.py",
line 252, in wrapper
File
"/Users/chaokunyang/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/compute.py",
line 215, in _handle_options
def _wrap_function(name, func):
File "pyarrow/_compute.pyx", line 1168, in
pyarrow._compute.SliceOptions.__init__
File "pyarrow/_compute.pyx", line 1147, in
pyarrow._compute._SliceOptions._set_options
TypeError: an integer is required
```
It would be nice to add such support into arrow compute.
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]