AlenkaF commented on code in PR #51484:
URL: https://github.com/apache/arrow/pull/51484#discussion_r4154501621
##########
python/pyarrow/pandas_compat.py:
##########
@@ -646,10 +646,13 @@ def convert_column(col, field):
f"had {result.null_count} null values")
return result
- def _can_definitely_zero_copy(arr):
- return (isinstance(arr, np.ndarray) and
- arr.flags.contiguous and
- issubclass(arr.dtype.type, np.integer))
+ def _can_definitely_zero_copy(ser):
+ if isinstance(ser.dtype, np.dtype):
+ arr = ser.values
Review Comment:
I think we are avoiding `.values` in case of pandas extension types, not
numpy dtypes for which a check is added here. Joris will correct me if I am
wrong.
--
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]