viirya commented on code in PR #50430:
URL: https://github.com/apache/arrow/pull/50430#discussion_r3631180240
##########
python/pyarrow/array.pxi:
##########
@@ -2776,6 +2820,16 @@ cdef class ListArray(BaseListArray):
Concrete class for Arrow arrays of a list data type.
"""
+ cdef object _getitem_py(self, int64_t i, object maps_as_pydicts):
+ cdef CListArray* arr = <CListArray*> self.ap
+ if arr.IsNull(i):
+ return None
+ if self._children_cache is None:
+ self._children_cache = pyarrow_wrap_array(arr.values())
+ cdef Array values = <Array> self._children_cache
+ cdef int64_t j, start = arr.value_offset(i), end = arr.value_offset(i
+ 1)
+ return [values._getitem_py(j, maps_as_pydicts) for j in range(start,
end)]
Review Comment:
Good catch — the C++ signatures all take `int64_t i`, so the `int`
declarations would let Cython silently truncate 64-bit indices on the new call
paths. Fixed in the base PR #50327 (9b1863dc75), which owns these declarations
and the list/map `_getitem_py` call sites; this branch is rebased on it. All
list-like, binary and dense-union `value_offset`/`value_length` declarations
now match the C++ headers.
--
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]