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

Fix #166 - Add docs for validating default values #168

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

stinovlas
Copy link
Contributor

Closes #166.

Add documentation for how the validating default default values in BaseSettings differs from those in pydantic.BaseModel.

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (3205f81) 97.45% compared to head (e5c06d5) 97.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #168   +/-   ##
=======================================
  Coverage   97.45%   97.45%           
=======================================
  Files           5        5           
  Lines         314      314           
  Branches       69       69           
=======================================
  Hits          306      306           
  Misses          6        6           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stinovlas stinovlas marked this pull request as ready for review September 15, 2023 14:03
@hramezani
Copy link
Member

Thanks @stinovlas for this PR 🙏

I've just simplified the examples.

@hramezani hramezani merged commit e62e3cf into pydantic:main Sep 18, 2023
20 checks passed
@stinovlas
Copy link
Contributor Author

Thanks @stinovlas for this PR 🙏

I've just simplified the examples.

I think the new examples do illustrate the technical aspect of not validating the default value, but lack the illustration of why would you do such a thing. I think my original examples illustrate that quite well and I took care to select example from Python standard library that exists in all Python versions supported by pydantic.

But if you think that the technical aspect is the most important and illustration of the issue is unnecessary, I can't force that on you.

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.

BaseSettings validates default field value
2 participants