Uh oh!
There was an error while loading. Please reload this page.
Bad type annotation for sa_type #1669
Replies: 1 comment
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
First Check
Commit to Help
Example Code
Description
When providing an argument to
sa_typeI always see that it's an instance of a class, and the linter doesn't like it because it should be something compatible withtype[Any]. I think in older versions ofsqlmodelthis parameter used to beAny.I think it could be replaced with
sqlalchemy.TypeEngine[Any]since most values forsa_typeare subclasses of that.Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.24
Python Version
3.13.9
Additional Context
VSCode + Pylance, strict type checking mode
All reactions