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

Update sub_types when calling update_forward_refs() #464

Merged
merged 4 commits into from Apr 11, 2019

Conversation

Projects
None yet
2 participants
@tiangolo
Copy link
Collaborator

commented Apr 5, 2019

Change Summary

Update sub_types when calling update_forward_refs()

update_forward_refs() currently updates a model's types by checking if they are ForwardRef.

This PR makes it also check sub-types, as would be needed for types like Union[ForwardRef('Node'), Leaf].

Related issue number

#404

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • HISTORY.rst has been updated
    • if this is the first change since a release, please add a new section
    • include the issue number or this pull request number #<number>
    • include your github username @<whomever>

tiangolo added some commits Apr 5, 2019

@codecov

This comment has been minimized.

Copy link

commented Apr 5, 2019

Codecov Report

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

@@          Coverage Diff          @@
##           master   #464   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines        2220   2225    +5     
  Branches      435    437    +2     
=====================================
+ Hits         2220   2225    +5
Show resolved Hide resolved pydantic/main.py Outdated
@tiangolo

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 5, 2019

This is ready for your review @samuelcolvin.

Let me know if you want me to move the function update_field_forward_refs from main.py to utils.py.

@samuelcolvin
Copy link
Owner

left a comment

otherwise LGTM.

Show resolved Hide resolved pydantic/main.py Outdated

@samuelcolvin samuelcolvin merged commit 63afb45 into samuelcolvin:master Apr 11, 2019

4 of 7 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 a704662
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@tiangolo tiangolo deleted the tiangolo:forward-ref-subtypes branch Apr 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.