jorisvandenbossche commented on a change in pull request #8072:
URL: https://github.com/apache/arrow/pull/8072#discussion_r480942913



##########
File path: python/pyarrow/table.pxi
##########
@@ -160,6 +160,8 @@ cdef class ChunkedArray(_PandasConvertible):
             return _normalize_slice(self, key)
         elif isinstance(key, int):
             return self.getitem(key)
+        elif np.isscalar(key) and np.issubdtype(key.dtype, np.integer):
+            return self.getitem(key)

Review comment:
       Alternative is to do like `array.pxi`, and let python/cython handle the 
cast to integer (and let it raise error otherwise:
   
   ```suggestion
           return self.getitem(_normalize_index(key, 
self.chunked_array.length()))
   ```
   
   (minor downside is that the error message will only speak about "integer", 
and not "slice", but then anything convertible to int will be accepted 
automatically)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to