Skip to content
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

Merged
merged 2 commits into from
Jan 30, 2024
Merged

Improve docs #225

merged 2 commits into from
Jan 30, 2024

Conversation

hramezani
Copy link
Member

No description provided.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (40230ab) 97.69% compared to head (a0e760d) 97.69%.

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.
📢 Have feedback on the report? Share it here.

Copy link

@gsakkis gsakkis left a 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.

Copy link

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RedisSettings still extends BaseSettings

@hramezani
Copy link
Member Author

Thanks @gsakkis
I've addressed both of your comments

@hramezani hramezani merged commit 0a00678 into main Jan 30, 2024
20 checks passed
@hramezani hramezani deleted the improve-docs branch January 30, 2024 12:56
@hramezani
Copy link
Member Author

Thanks @gsakkis for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants