Skip to content

GH-15047: [Python]: switch from pytz to zoneinfo by default for string to tzinfo conversion#49694

Draft
jorisvandenbossche wants to merge 4 commits intoapache:mainfrom
jorisvandenbossche:gh-15047-pytz-to-zoneinfo
Draft

GH-15047: [Python]: switch from pytz to zoneinfo by default for string to tzinfo conversion#49694
jorisvandenbossche wants to merge 4 commits intoapache:mainfrom
jorisvandenbossche:gh-15047-pytz-to-zoneinfo

Conversation

@jorisvandenbossche
Copy link
Copy Markdown
Member

@jorisvandenbossche jorisvandenbossche commented Apr 8, 2026

Rationale for this change

zoneinfo is available starting with Python 3.9, so we can now assume that it is available, and so we can switch from by default returning pytz timezones to return zoneinfo timezones (or datetime.timezone for fixed offsets).

Only keeping pytz as fallback for strings that are not supported by zoneinfo but were supported by pytz. Later, we should maybe deprecate that fallback.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

This PR includes breaking changes to public APIs.

It is a different object that we return (different class), which a different API, so for people relying on that, this is a breaking change.

@jorisvandenbossche jorisvandenbossche marked this pull request as draft April 8, 2026 18:03
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

⚠️ GitHub issue #15047 has been automatically assigned in GitHub to PR creator.

@jorisvandenbossche
Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-pandas

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Revision: dc184fe

Submitted crossbow builds: ursacomputing/crossbow @ actions-cdf269df89

Task Status
test-conda-python-3.10-pandas-1.3.4-numpy-1.21.2 GitHub Actions
test-conda-python-3.11-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.12-pandas-latest-numpy-1.26 GitHub Actions
test-conda-python-3.12-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.13-pandas-nightly-numpy-nightly GitHub Actions
test-conda-python-3.13-pandas-upstream_devel-numpy-nightly GitHub Actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant