New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify flatteining and inlining of Coreschema #7523
Conversation
Deploying with Cloudflare Pages
|
2286794
to
fcb97b4
Compare
please review |
tests/test_model_signature.py
Outdated
IntModel = Model[int] | ||
|
||
assert IntModel.model_validate({'a': '1'}).a == 1 | ||
|
||
sig = signature(IntModel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the cause of this is that the following code is firing on this branch from _model_construction.py
:
if collect_invalid_schemas(schema):
set_model_mocks(cls, cls_name)
return False
I suggest we understand this further - smells like a possible bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's xfail instead of modify, I will dig into this in parallel.
@dmontagu, @samuelcolvin, this changes breaks compatibility of https://github.com/aiogram/aiogram with pydantic 2.4
You can check it by installing |
Thanks for the report, we're investigating. |
# we assume the shape of the core schema here, which is not a guarantee | ||
# pydantic makes to its users but is useful to check here to make sure | ||
# we are doing the right thing internally |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Selected Reviewer: @davidhewitt