Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
Slice an arrow array can lead to a negative length, when instead it should never be smaller than 0.
arr = pa.array(range(10))
assert len(arr[-9:-20]) == 0
Array.length() returns -1 which makes the previous snippet crash as Python never accepts length < 0
In particular if you have Python in debug mode it will explicitly fail the related assertion
Assertion failed: (len >= 0 || PyErr_Occurred()), function PyObject_Size, file Objects/abstract.c, line 61
Attachments
Issue Links
- is a clone of
-
ARROW-12769 [Python] Negative out of range slices yield invalid arrays
- Resolved