jorisvandenbossche commented on code in PR #41071:
URL: https://github.com/apache/arrow/pull/41071#discussion_r1557662389
##########
python/pyarrow/array.pxi:
##########
@@ -1543,7 +1543,20 @@ cdef class Array(_PandasConvertible):
def _to_pandas(self, options, types_mapper=None, **kwargs):
return _array_like_to_pandas(self, options, types_mapper=types_mapper)
- def __array__(self, dtype=None):
+ def __array__(self, dtype=None, copy=None):
+ # TODO honor the copy=True case
Review Comment:
> and also a bit harder to implement
On second thought, it might be relatively easy to determine if `to_numpy()`
returned a copy or not? I was first thinking we would have to mimic the logic
based on the type ("if primitive and no nulls, then it is zero copy"), but we
might be able to check if the resulting ndarray has a base pointing to a
pyarrow object?
Although the simple logic of numeric+no nulls might be easier in practice.
--
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]