You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2026/09/11 08:34:07 UTC

[I] [Python] Update pandas->pyarrow conversion for the .values deprecation in pandas [arrow]

jorisvandenbossche opened a new issue, #51302:
URL: https://github.com/apache/arrow/issues/51302

   Pandas has deprecated certain aspects of `.values` (when it looses information), which our pandas->pyarrow conversion currently relies upon, so in the tests with pandas nightly we are seeing a lot of warnings because of that (https://github.com/ursacomputing/crossbow/actions/runs/34548523730/job/103106277981).
   
   Small illustration:
   
   ```python
   >>> import pandas as pd
   >>> import pyarrow as pa
   >>> ser = pd.Series(pd.date_range("2025-01-01", periods=3, tz="UTC"))
   >>> pa.array(ser)
   <python-input-4>:1: Pandas4Warning: Series.values returning an ndarray that drops timezone information for DatetimeTZDtype is deprecated. In a future version, this will return the underlying DatetimeArray instead. Use 'Series.to_numpy()' to get a NumPy array, or 'Series.array' to get the ExtensionArray.
   <pyarrow.lib.TimestampArray object at 0x7ff624fb1a20>
   [
     2025-01-01 00:00:00.000000Z,
     2025-01-02 00:00:00.000000Z,
     2025-01-03 00:00:00.000000Z
   ]
   ```
   
   This is caused by our handling of a Series object in `pa.array(..)`:
   
   https://github.com/apache/arrow/blob/07be48c5402adedb68c510531939a907ffbac237/python/pyarrow/array.pxi#L5396-L5407
   
   and
   
   https://github.com/apache/arrow/blob/07be48c5402adedb68c510531939a907ffbac237/python/pyarrow/pandas-shim.pxi#L231-L242
   
   So we already have some custom handling for Period/Interval, but that will also be needed for DatetimeTZDtype


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

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


Re: [I] [Python] Update pandas->pyarrow conversion for the .values deprecation in pandas [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF closed issue #51302: [Python] Update pandas->pyarrow conversion for the .values deprecation in pandas
URL: https://github.com/apache/arrow/issues/51302


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

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


Re: [I] [Python] Update pandas->pyarrow conversion for the .values deprecation in pandas [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #51302:
URL: https://github.com/apache/arrow/issues/51302#issuecomment-5930210730

   Issue resolved by pull request 51484
   https://github.com/apache/arrow/pull/51484


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