jorisvandenbossche commented on code in PR #43795:
URL: https://github.com/apache/arrow/pull/43795#discussion_r1741931630
##########
python/pyarrow/table.pxi:
##########
@@ -1407,6 +1435,20 @@ cdef class ChunkedArray(_PandasConvertible):
self.init(c_chunked_array)
return self
+ @property
+ def is_cpu(self):
+ """
+ Whether all chunks in the ChunkedArray are CPU-accessible.
+ """
+ cdef c_bool result
+ with nogil:
+ result = self.chunked_array.is_cpu()
Review Comment:
If this is supposed to be very fast / cached on the C++ side, then it might
be better to not use `with nogil`. Right now this attribute is called in many
of the methods, so that means for all those methods an additional
release/re-acquire GIL, which can give some overhead.
In practice, this tends to get called for methods that will do some work for
the remainder of the method (since fast things like getting the shape doesn't
call `_assert_cpu`), so maybe this is not too important.
--
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]