You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
python typegen output fails to import on python 3.9 and 3.10 (NotRequired, TypeAlias from typing) #1088
Import both names from typing_extensions instead. The generated code already depends on pydantic, and pydantic depends on typing_extensions, so this adds no new requirement for users:
I reproduced this on current master and would like to take it.
Verified with clean Python containers:
Python 3.9: ImportError: cannot import name 'NotRequired' from 'typing'
Python 3.10: the same NotRequired import failure
Python 3.11: the current import succeeds
Plan:
Move NotRequired and TypeAlias to typing_extensions in the Python type generator while leaving the remaining imports in typing.
Update the generated Python inline snapshot / focused generator assertions.
Validate generated output imports under Python 3.9, 3.10, and a current Python version with Pydantic installed, then run the TypeScript check and relevant test suite.
I’ll keep this scoped to generated-code compatibility and won’t add a new runtime dependency to postgres-meta itself.
Go for it, glad it reproduced cleanly. If anything in the report is unclear while you build the fix, ping me here, happy to test the PR on 3.9 and 3.10.
CI is waiting on workflow approval for first-time contributors. Happy to address any feedback once the checks run. Also welcome a 3.9/3.10 smoke test on your side if you still have bandwidth.
Activity
sornapudisuresh commentedon Jul 29, 2026
I reproduced this on current
masterand would like to take it.Verified with clean Python containers:
ImportError: cannot import name 'NotRequired' from 'typing'NotRequiredimport failurePlan:
NotRequiredandTypeAliastotyping_extensionsin the Python type generator while leaving the remaining imports intyping.I’ll keep this scoped to generated-code compatibility and won’t add a new runtime dependency to postgres-meta itself.
tushardev-365 commentedon Jul 29, 2026
Go for it, glad it reproduced cleanly. If anything in the report is unclear while you build the fix, ping me here, happy to test the PR on 3.9 and 3.10.
sornapudisuresh commentedon Jul 29, 2026
Thanks @tushardev-365 — the PR is up: #1094
CI is waiting on workflow approval for first-time contributors. Happy to address any feedback once the checks run. Also welcome a 3.9/3.10 smoke test on your side if you still have bandwidth.