Skip to content

Migrate Arrow to use ZoneInfo for timezones #1217

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

Merged
merged 5 commits into from
Aug 7, 2025
Merged

Conversation

jadchaar
Copy link
Member

@jadchaar jadchaar commented Jul 8, 2025

  • Fix test errors and deprecation warnings
  • Migrate to timezone.utc
  • Migrate from tzlocal to datetime.now().astimezone()
  • Upgrade dependencies

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

  • 🧪 Added tests for changed code.
  • 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • 📚 Updated documentation for changed code.
  • ⏩ Code is up-to-date with the master branch.

If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!

Description of Changes

Migrate Arrow to use ZoneInfo from PEP 615 standard - https://peps.python.org/pep-0615/. This reduces our reliance on dateutil's tz data base and instead uses the standard library.

Closes: #825
Closes: #1094

jadchaar added 5 commits July 5, 2025 17:34
  - Fix Asia/Hanoi timezone issue by filtering timezone list to only
  include zoneinfo-compatible timezones
  - Fix Anchorage DST test by using correct time after spring-forward
  transition (3:01 AM instead of 2:01 AM)
  - Replace deprecated datetime.utcfromtimestamp() with
  datetime.fromtimestamp(timestamp, timezone.utc)
  - Update timezone test utilities to ensure compatibility with zoneinfo
  migration
@jadchaar jadchaar marked this pull request as ready for review July 8, 2025 04:17
@krisfremen krisfremen self-requested a review July 24, 2025 06:18
Copy link
Member

@anishnya anishnya left a comment

Choose a reason for hiding this comment

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

LGTM!

@jadchaar jadchaar merged commit 97695bf into master Aug 7, 2025
42 checks passed
@jadchaar jadchaar deleted the migrate-zoneinfo branch August 7, 2025 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question] Can remove dateutil from dependency? Consider backporting PEP 615
3 participants