Skip to content

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Sep 10, 2019

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.rst file added describing change
    (see changes/README.md for details)

@codecov
Copy link

codecov bot commented Sep 10, 2019

Codecov Report

Merging #803 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #803   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          17     17           
  Lines        2985   2989    +4     
  Branches      580    583    +3     
=====================================
+ Hits         2985   2989    +4
Impacted Files Coverage Δ
pydantic/color.py 100% <ø> (ø) ⬆️
pydantic/main.py 100% <100%> (ø) ⬆️
pydantic/types.py 100% <100%> (ø) ⬆️
pydantic/schema.py 100% <100%> (ø) ⬆️
pydantic/fields.py 100% <100%> (ø) ⬆️
pydantic/class_validators.py 100% <100%> (ø) ⬆️
pydantic/networks.py 100% <100%> (ø) ⬆️
pydantic/validators.py 100% <100%> (ø) ⬆️
pydantic/error_wrappers.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd32a43...bfe224a. Read the comment docs.

@samuelcolvin samuelcolvin marked this pull request as ready for review September 16, 2019 11:17
@samuelcolvin
Copy link
Member Author

This is ready for review.

@dmontagu @tiangolo and anyone else interested: would be great if you could review.

Significant changes:

  • validators keyword argument whole has been replaced by each_item, inverse meaning and default to False, eg. now by default validators apply to the whole field not each item. whole is currently still supported with a depreciation warning.
  • when using Optional[str] or similar, the None case is now handled explicitly and subfields are not populated, this:
    • improves performance
    • simplifies errors, by remove "value is not None" from appearing in many situations
    • simplifies schema generation that had to explicitly remove the None option from unions
  • The custom behaviour for the Json type has been replaced by adding a pre_validator

There are a few other tweaks, but nothing that should effect end users.

@samuelcolvin samuelcolvin added this to the Version 1 milestone Sep 17, 2019
@samuelcolvin samuelcolvin mentioned this pull request Sep 17, 2019
4 tasks
Copy link
Contributor

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 🎉

@samuelcolvin samuelcolvin merged commit 16263ba into master Sep 18, 2019
@samuelcolvin samuelcolvin deleted the none-behaviour branch September 18, 2019 10:38
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

2 participants