Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature Request: replace pytz with zoneinfo? #406

jklaiho started this conversation in Ideas
Discussion options

Python has had the zoneinfo library since 3.9, and pytz is widely considered a legacy project that was necessary at one time, but no longer. (E.g. Django dropped support for it in 5.0.) For more background, see here.

In this project, pytz is included in pyproject.toml only in the test and scripts dependency groups, despite it actually being a runtime dependency, apparently for TIMESTAMPTZ support (correct me if I'm wrong). I transitioned away from pytz to zoneinfo in a Django project that also has duckdb-python, and after removing pytz my server startup (where I'm performing a schema check on a table with a TIMESTAMPTZ field) started failing:

_duckdb.InvalidInputException: Invalid Input Error: Required module 'pytz' failed to import, due to the following Python exception:
ModuleNotFoundError: No module named 'pytz'

Quick and dirty fix: pytz should at the very least be in optional-dependencies.all in pyproject.toml.

Better fix: drop pytz and use zoneinfo instead; one less external dependency to worry about.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /