apache / apache/arrow

[Python] BUG: `pyarrow.compute.utf8_slice_codeunits` allows for float start, stop arguments

Open
#35,385 2 comments 0 reactions 0 assignees View on GitHub
Component: Python Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

### Describe the bug, including details regarding any error messages, version, and platform.

```
In [3]: pa.__version__
Out[3]: '11.0.0'

In [4]: arr = pa.array(["abc"])

In [5]: pa.compute.utf8_slice_codeunits(arr, start=1.2, stop=2.2)
Out[5]:

[
"b"
]
```

I would expect this to raise a `ValueError` as the documentation says these arguments should be ints

Related:

* https://github.com/apache/arrow/issues/34929

### Component(s)

Python

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported call to pyarrow.compute.utf8_slice_codeunits with float start and stop arguments, then trace the Python entry point and its argument validation. Check the existing documentation and tests for these parameters; done means non-integer arguments raise ValueError while integer slicing remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.