Static Typing Fails on Nested SQLModel #755
Unanswered
martinralfreindl
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
SITUATION:
I recently updated to SQLModel 0.0.14 and have since started experiencing static typing issues with SQLModel.
COMPLICATION
Whenever I nest two SQLModels, static typing fails to execute correctly.
The example above is one instance of this behavior:
User
inherits from SQLModelProfile
is a regular Python class (inheriting from object)Settings
contains nested User and Profile models, both of which are not optionalSettings
constructor, both of them should throw static errors (None is not an acceptable subtype of User and Profile after all), but for some reason the user property accepts None without issues.QUESTION
The code above minimally reproduces the faulty behavior on my machine. What am I doing wrong here? Is this a bug in SQLModel or my setup?
Operating System
macOS
Operating System Details
I'm running all of this in VSCode
SQLModel Version
0.0.14
Python Version
3.11.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions