AlenkaF commented on issue #37009:
URL: https://github.com/apache/arrow/issues/37009#issuecomment-1681644987
The errors do seem related to the ones you listed. Could we first check the
package versions?
When running on pyarrow dev and pandas 2.0.0 the code seems to work for me:
```python
>>> import pyarrow as pa
>>> import pandas as pd
>>> pa.__version__
'13.0.0.dev670+g757e0d5cc'
>>> pd.__version__
'2.0.0'
>>> df = pa.table(
... {"col1": pa.array([pd.Timestamp.utcnow()], pa.timestamp("ns",
"UTC"))}
... ).to_pandas(types_mapper=pd.ArrowDtype)
assert df["col1"].dtype == pd.ArrowDtype(pa.timestamp("ns", "UTC"))>>>
assert df["col1"].dtype == pd.ArrowDtype(pa.timestamp("ns", "UTC"))
>>> df
col1
0 2023-08-17 05:36:07.142786+00:00
>>> df["col1"]
0 2023-08-17 05:36:07.142786+00:00
Name: col1, dtype: timestamp[ns, tz=UTC][pyarrow]
>>> pa.array([pd.Timestamp.utcnow()], pa.timestamp("ns", "UTC")).to_pandas(
... types_mapper=pd.ArrowDtype
... )
0 2023-08-17 05:36:15.453414+00:00
dtype: timestamp[ns, tz=UTC][pyarrow]
```
Which versions are you using @0x26res?
--
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]