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


##########
python/pyarrow/pandas_compat.py:
##########
@@ -578,7 +578,7 @@ def dataframe_to_types(df, preserve_index, columns=None):
     types = []
     # If pandas knows type, skip conversion
     for c in columns_to_convert:
-        values = c.values
+        values = _pandas_api.get_values(c)

Review Comment:
   This only updates the type-inference path; the default 
`Table.from_pandas(..., nthreads=None)` still enters the parallel branch and 
`_can_definitely_zero_copy` reads `c.values` for every column at line 661. A 
`DatetimeTZDtype` column therefore continues to emit the pandas deprecation 
warning during normal DataFrame conversion, so the issue is not fully fixed. 
Route that zero-copy check through the same value-extraction helper (or 
otherwise avoid `.values` for these dtypes), and cover the default threaded 
path with a warning assertion.



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

Reply via email to