You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2023/09/05 10:15:53 UTC
[GitHub] [arrow] AlenkaF commented on issue #37545: to_pandas(date_as_object=False) returns different dtype in pyarrow 13.0.0
AlenkaF commented on issue #37545:
URL: https://github.com/apache/arrow/issues/37545#issuecomment-1706339577
Yes, correct. This behaviour changed from `pyarrow` version `12.0.1` to `13.0.0`. Here is the PR that changed it: https://github.com/apache/arrow/pull/35656
From the PR:
> This PR adds support for the following Arrow -> Pandas conversions, which previously all defaulted to datetime64[ns] or datetime64[ns, <TZ>]:
> date32 -> datetime64[ms]
> date64 -> datetime64[ms]
> ...
Also mentioned in the PR description:
> Arrow-to-pandas default conversion behavior will change when users have pandas >= 2.0, but a legacy option is exposed to provide backwards compatibility.
So in your reprex you could do:
```python
>>> pa.__version__
'13.0.0'
>>> table.to_pandas(date_as_object=False, coerce_temporal_nanoseconds=True)["date"].dtype
dtype('<M8[ns]')
```
But note the comment: https://github.com/apache/arrow/blob/a526ba697d4e3f009731bebda6838b41899051e3/python/pyarrow/array.pxi#L782-L788
--
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