-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
upgrade from pydantic v2.4.3 to v2.5.1 introduced a regression using BaseSettings
with union-types
#190
Comments
Thanks @spex66 for reporting this. Yeah, as you mentioned the fix is the change The reason for this problem is when you initialize the we had the same behavior in 2.4.2 (initializing all the models) but I don't know what exactly was the change in 2.5. probably @davidhewitt can explain. |
thx @hramezani for your quick feedback! But I can confirm that I double checked today, switching versions back and forth, that this code was working. |
hi @hramezani
ofc I have no idea which change in pydantic or core has resolved it, maybe you have an idea? |
I think it was a bug that was introduced and got fixed. Thanks for letting us know. |
@spex66 @hramezani I'm not aware of a particular bug that would have caused this and since been fixed. I tried to repro with the versions listed here, I cannot repro with any of 2.5.0, 2.5.1, or 2.5.2. Strange. |
I wasn't able to isolate the core of this problem yet which happens after updating dependencies
FYI pydantic v2.5 release notes mention:
Following is a stripped down example, in original code I need
BaseSettings
, so pls don't repond how I can by-pass the problem :)And
extra='forbid'
is needed to (which is default for BaseSettings).versions
which fail the test
which pass the test
reproduction steps
test_steps_alternative()
) failsBaseSettings
withBaseModel
makes the pass successfulerror message
The text was updated successfully, but these errors were encountered: