Skip to content

Convert TIMESTAMPTZ to Python through zoneinfo instead of pytz - #710

Open
evertlammerts wants to merge 2 commits into
duckdb:v2.0-cyanopterafrom
evertlammerts:zoneinfo-timestamptz
Open

evertlammerts wants to merge 2 commits into
duckdb:v2.0-cyanopterafrom
evertlammerts:zoneinfo-timestamptz

Conversation

@evertlammerts

Copy link
Copy Markdown
Member

Fetching a TIMESTAMPTZ as a Python value needed pytz, which no dependency group declares, so a clean install failed with "Required module 'pytz' failed to import" (#406). pytz's tables end at 2037, so every DST instant from 2038 on came back one hour off (#579).

Change: PythonObject::FromValue builds the value from datetime.timezone.utc and zoneinfo.ZoneInfo(TimeZone). The pytz import cache item and every pytz pin in pyproject, the benchmarks and the tests are gone.

We throw an error instead of relying on a pytz dependency when zoneinfo has no database (Windows without the tzdata package, or an ICU name IANA lacks such as ACT). Only this fetch path needs it, and a dependency would reach every install.

@evertlammerts
evertlammerts added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026

This branch has not been deployed

No deployments
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.

1 participant