-
-
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
Improve docs #225
Improve docs #225
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
=======================================
Coverage 97.69% 97.69%
=======================================
Files 5 5
Lines 347 347
Branches 76 76
=======================================
Hits 339 339
Misses 6 6
Partials 2 2 ☔ View full report in Codecov by Sentry. |
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.
Thanks @hramezani, I left two minor comments
!!! note | ||
Pydantic settings loads all the values from dotenv file and passes it to the model. So, `ValidationError` will raise | ||
if you provide extra values in a dotenv file. | ||
|
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.
This note should emphasize that env_prefix
is not taken into account. So perhaps something like:
Pydantic settings loads all the values from dotenv file and passes it to the model, regardless of the model's `env_prefix`.
So if you provide extra values in a dotenv file, whether they start with `env_prefix` or not,
a `ValidationError` will be raised.
!!! note | ||
Sub model has to inherit from `pydantic.BaseModel`, Otherwise `pydantic-settings` will initialize sub model, | ||
collects values for sub model fields separately, and you may get unexpected results. | ||
|
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.
RedisSettings
still extends BaseSettings
Thanks @gsakkis |
Thanks @gsakkis for the review |
No description provided.