Skip to content

fix: support Python 3.9 type generation - #1094

Open
sornapudisuresh wants to merge 1 commit into
supabase:masterfrom
sornapudisuresh:fix/1088-python-typing-extensions
Open

fix: support Python 3.9 type generation#1094
sornapudisuresh wants to merge 1 commit into
supabase:masterfrom
sornapudisuresh:fix/1088-python-typing-extensions

Conversation

@sornapudisuresh

Copy link
Copy Markdown

Summary

  • import NotRequired and TypeAlias from typing_extensions
  • support generated Python types on Python 3.9 and 3.10
  • add a focused regression test and update the integration snapshot

Test plan

  • npm run check
  • Prettier check passed
  • focused Python generator unit test passed
  • Python generator integration test passed
  • imports validated with Pydantic on Python 3.9, 3.10, and 3.11

Fixes #1088

@tushardev-365

Copy link
Copy Markdown

Ran the 3.9/3.10 smoke test I offered. Took your branch's generated header (the typing_extensions import) with a TypedDict using NotRequired plus a TypeAlias, and it imports cleanly on both 3.9 and 3.10. The pre-fix form (those two names from typing) still throws the original ImportError on both, and 3.12 passes either way as expected. Fix looks good.

@sornapudisuresh

Copy link
Copy Markdown
Author

Thanks @tushardev-365 for verifying both the pre-fix failure and corrected imports on Python 3.9 and 3.10!

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.

python typegen output fails to import on python 3.9 and 3.10 (NotRequired, TypeAlias from typing)

2 participants