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 creating two sub models(A, B) from Pydantic BaseModel, with fields infos defined in Config. Then creating another two sub models(Model1, Model2) from A and B, trying to rewrite the extra keys (we used level in the following code) in field info. Only one of the sub models can re-write the extra value correctly.
As shown in the following code, extra in m2.fields["root"].field_info got level=3, but for m1 it still got level=1.
You wrote Config.field for model B instead of Config.fields hence the difference.
Now you're right the output is not the expected one. I'll open a fix shortly
You wrote Config.field for model B instead of Config.fields hence the difference.
Now you're right the output is not the expected one. I'll open a fix shortly
Sorry for the mistake Lol, and thanks for your reply!
Checks
Bug
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:When creating two sub models(A, B) from Pydantic BaseModel, with fields infos defined in Config. Then creating another two sub models(Model1, Model2) from A and B, trying to rewrite the extra keys (we used
level
in the following code) in field info. Only one of the sub models can re-write the extra value correctly.As shown in the following code,
extra
in m2.fields["root"].field_info got level=3, but for m1 it still got level=1.The text was updated successfully, but these errors were encountered: