jorisvandenbossche commented on PR #36314:
URL: https://github.com/apache/arrow/pull/36314#issuecomment-1611070229
Hmm, so the failing tests point out an issue with this approach: we have
some keywords to control the conversion, notably `timestamp_as_object` in this
case.
And if the user passes this, and we just call `pandas_dtype.__from_arrow__`
nonetheless, this keyword gets ignored.
But, we also already have this problem, as this already happens for the
ChunkedArray conversion:
```
In [8]: from datetime import datetime
...: import pyarrow as pa
...:
...: arr = pa.array([datetime(2001, 1, 1)], pa.timestamp("s",
tz="America/New_York"))
...: table = pa.table({'a': arr})
In [9]: arr.to_pandas(timestamp_as_object=True)
Out[9]:
0 2000-12-31 19:00:00-05:00
dtype: object
In [10]: table["a"].to_pandas(timestamp_as_object=True)
Out[10]:
0 2000-12-31 19:00:00-05:00
Name: a, dtype: datetime64[ns, America/New_York]
```
--
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]