Skip to content
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

REF: Prefer testing and documenting zoneinfo instead of pytz #59016

Merged
merged 3 commits into from
Jun 24, 2024

Conversation

mroeschke
Copy link
Member

Split off from #57045

  • Add more documentation about zoneinfo.ZoneInfo objects being accepted
  • Changed tests/benchmark to prefer stdlib timezone objects instead of pytz objects e.g. pytz.utc -> datetime.timezone.utc, pytz.timezone("US/Pacific") -> zoneinfo.ZoneInfo("US/Pacific")

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Docs Timezones Timezone data dtype labels Jun 14, 2024
@mroeschke mroeschke added this to the 3.0 milestone Jun 14, 2024
@@ -2337,7 +2337,7 @@ Time zone handling
------------------

pandas provides rich support for working with timestamps in different time
zones using the ``pytz`` and ``dateutil`` libraries or :class:`datetime.timezone`
zones using the ``zoneinfo``, ``pytz`` and ``dateutil`` libraries or :class:`datetime.timezone`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even really need to advertise pytz any more or can it be fully replaced by zoneinfo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think zoneinfo objects support all operations that pytz does. I was planning on keeping it around since it will be supported via an optional dependency I suppose.

If we ever deprecate pytz support, I would fully support not advertising it anymore

@mroeschke
Copy link
Member Author

Going to merge this PR to make progress on #57045, happy to follow up if needed

@mroeschke mroeschke merged commit 1cf98aa into pandas-dev:main Jun 24, 2024
47 checks passed
@mroeschke mroeschke deleted the pre/tz/zoneinfo branch June 24, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Testing pandas testing functions or related to the test suite Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants