-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
API: default to stdlib timezone objects for fixed-offsets #49677
Conversation
This made me realize that Are you thinking of still fully pursuing the "default to IMO in an ideal world it would be nice to default to |
Agreed. One option would be to make the changeover in 2.0 for all-but-py38 |
Mothballing until we drop py38 so we can do non-fixed tzinfos at the same time. in practice this means 3.0 |
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.
Looks good to me, thanks @jbrockmendel
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.
Do we have a test that asserts that Timestamp.utcnow().tz.
or Timestamp(..., tz="UTC").tz
returns datetime.timezone.utc
?
For datetime.__eq__
, this compares to equal althought the UTC objects are different
>>> import pytz
>>> import datetime
>>> d1 = datetime.datetime(2022, 1, 1, tzinfo=pytz.UTC)
>>> d2 = datetime.datetime(2022, 1, 1, tzinfo=datetime.timezone.utc)
>>> d1 == d2
True
no, will update |
Thanks @jbrockmendel |
updated tests to handle pandas-dev/pandas#49677
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.addresses part of #34916 but does not address non-fixed-offset tzs