-
-
Notifications
You must be signed in to change notification settings - Fork 89
Validation error for 3 levels of nested dicts in v2.3.0 #300
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
Comments
chiming in on this if I may, the following fails with the same error when I set from pydantic import BaseModel
from pydantic_settings import BaseSettings, SettingsConfigDict
class NestedModel(BaseModel):
val: str
class Settings(BaseSettings):
val: str
nested: dict[str, NestedModel]
model_config = SettingsConfigDict(
env_nested_delimiter="__",
)
if __name__ == "__main__":
Settings(val="test") |
Thanks @bpicardat for reporting this. Yes, this is a regression in a853a13 I will prepare a fix for that. meanwhile you can fix the problem by setting env like: env.set('nested', '{"foo": {"a": {"b": "bar"}}}') |
Thanks @xaniasd for reporting. you can also set the env like I am trying to prepare a fix |
@bpicardat @xaniasd I created #301 to fix the problem. Could you please confirm? then I can prepare a patch release soon |
@hramezani I confirm that the branch issue-300 fixed my issue. Thank you ! |
Fixed in ad07a57 |
The fix has been released in |
Hello,
My model does not work anymore with the latest version of pydantic-settings.
Here is a test that reproduces my issue (
env
is the fixture from the pydantic-settings tests):This test passes in version 2.2.1 of pydantic-settings but fails in version 2.3.0 with error:
This happens with Python 3.11.9 on Linux, and the following packages:
Is this considered a regression or should I find an alternative way to solve my issue?
The text was updated successfully, but these errors were encountered: