You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "raulcd (via GitHub)" <gi...@apache.org> on 2026/10/01 10:37:53 UTC

Re: [PR] GH-51302: [Python] Avoid deprecated .values call in pandas->pyarrow conversion [arrow]

raulcd commented on code in PR #51484:
URL: https://github.com/apache/arrow/pull/51484#discussion_r4154451518


##########
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:
   Aren't we avoiding to use the `.values` calls? Or is this something different?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org