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
When providing an argument to sa_type I always see that it's an instance of a class, and the linter doesn't like it because it should be something compatible with type[Any]. I think in older versions of sqlmodel this parameter used to be Any.
I think it could be replaced with sqlalchemy.TypeEngine[Any] since most values for sa_type are subclasses of that.
Argument of type "DateTime" cannot be assigned to parameter "sa_type" of type "Type[Any] | PydanticUndefinedType" in function "Field"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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