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
merged 18 commits into from Sep 18, 2019
Merged

None behaviour #803

merged 18 commits into from Sep 18, 2019

Conversation

@samuelcolvin
Copy link
Owner

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

This comment has been minimized.

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 force-pushed the none-behaviour branch from a7e0516 to b807fca Sep 16, 2019
@samuelcolvin samuelcolvin marked this pull request as ready for review Sep 16, 2019
@samuelcolvin samuelcolvin requested review from tiangolo and dmontagu Sep 16, 2019
@samuelcolvin

This comment has been minimized.

Copy link
Owner Author

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 of 4 tasks complete
Copy link
Collaborator

tiangolo left a comment

LGTM 🚀 🎉

@samuelcolvin samuelcolvin force-pushed the none-behaviour branch from 73f6537 to bfe224a Sep 18, 2019
@samuelcolvin samuelcolvin merged commit 16263ba into master Sep 18, 2019
12 checks passed
12 checks passed
Header rules No header rules processed
Details
Pages changed All files already uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/project 100% (+0%) compared to dd32a43
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details
samuelcolvin.pydantic Build #20190918.6 succeeded
Details
samuelcolvin.pydantic (Job Python36) Job Python36 succeeded
Details
samuelcolvin.pydantic (Job Python37) Job Python37 succeeded
Details
@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
Projects
None yet
2 participants
You can’t perform that action at this time.