Replies: 2 comments
|
@tiangolo Should I move this to a regular Issue? I don't know if this is the right place for this given that I'm not raising something so much as pointing out a bug |
0 replies
|
The problem is that the first model that passes validation is being chosen as resulting. Still this is different from how Pydantic models work - with Pydantic models it works regardless the order |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
First Check
Commit to Help
Example Code
Description
I have a similar but equally weird issue. I am using a
Unionand aTypeAdapterand somehow, usingSQLModelrather thanBaseModelbreaks the automatic detection of which class should be chosen. The only thing that I can see that could be the cause is that class B inherits from class A.The
TypeAdapterproducesA(a=1)instead of `B(a=1, b='s').Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.22
Python Version
Python 3.12.7
Additional Context
I initially thought that this was intended/broken behavior in
pydantic, spent a lot of time trying to write tests and fix their Rust code with AI helpers... only to realize that this is actually asqlmodelbug :'(All reactions