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

None behaviour #803

merged 18 commits into from Sep 18, 2019

None behaviour #803

merged 18 commits into from Sep 18, 2019


Copy link

@samuelcolvin samuelcolvin commented Sep 10, 2019


  • 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/ for details)

Copy link

@codecov 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/ 100% <ø> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 100% <100%> (ø) ⬆️
pydantic/ 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 Sep 16, 2019
@samuelcolvin samuelcolvin requested review from tiangolo and dmontagu Sep 16, 2019
Copy link
Owner Author

@samuelcolvin samuelcolvin commented Sep 16, 2019

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
Sponsor Collaborator

@tiangolo tiangolo left a comment

LGTM 🚀 🎉

@samuelcolvin samuelcolvin merged commit 16263ba into master Sep 18, 2019
12 checks passed
@samuelcolvin samuelcolvin deleted the none-behaviour branch Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants