-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: add __from_pyarrow__
support to DatetimeTZDtype
#52201
ENH: add __from_pyarrow__
support to DatetimeTZDtype
#52201
Conversation
4d46462
to
6985319
Compare
Any additional feedback on this? All checks have been green, and it's aligned with what we do for the other Extension Dtypes. |
I'd like to see more buy-in on ignoring iNaT |
I would be okay with ignoring iNaT for now. Would be good to write a comment in |
…timeTZDtype-from_arrow
… into DatetimeTZDtype-from_arrow
Thanks @mroeschke @jbrockmendel I've added a docstring to |
Looks like |
Thanks for the FYI. Looks like maybe some different assumptions about timezones in latest pyarrow? I'll investigate. |
Possible bug with: apache/arrow#34270 ? If the timezones aren't the same (or UTC and naive) then it shouldn't be no-copy, right? |
@mroeschke I think I found the issue. I don't think I should be calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing! Will merge in a few days in there's no other comments
Thanks for sticking with this @tswast |
…35546) ### Rationale for this change In pandas version 2.1.0 `__from_arrow__` method has been implemented for `DatetimeTZDtype` extension type. See pandas-dev/pandas#52201. Due to this change, the conversion from pyarrow table column with datetime uses the newly implemented `__from_arrow__` method for the pandas dtype and `pandas_api.series` to construct the pandas series. We had to pass the name in the `pandas_api.series` also, to fix failing tests in #35248. This PR adds explicit test for this change. * Closes: #35250 Authored-by: Alenka Frim <frim.alenka@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Closes #52200