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(schema): use right type check for __modify_schema__ #1562

Merged
merged 1 commit into from Jun 27, 2020

Conversation

PrettyWood
Copy link
Member

Change Summary

As @therefromhere explains in #1552, __modify_schema__ was called for the schema field but also for the list schema because field.type_ would be the same in both cases.
Changed it to field.outer_type_

Related issue number

fix #1552

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>.md file added describing change
    (see changes/README.md for details)

@codecov
Copy link

codecov bot commented May 26, 2020

Codecov Report

Merging #1562 into master will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #1562   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3793      3793           
  Branches       752       752           
=========================================
  Hits          3793      3793           
Impacted Files Coverage Δ
pydantic/schema.py 100.00% <100.00%> (ø)

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 5195e55...d560c57. Read the comment docs.

@therefromhere
Copy link
Contributor

Just to confirm, this fixes the issue I was seeing, thanks! 👍

@PrettyWood PrettyWood changed the title (fix) use right type check when modifying schema fix(schema): use right type check for __modify_schema__ May 31, 2020
@samuelcolvin samuelcolvin merged commit 7ac9faf into pydantic:master Jun 27, 2020
@samuelcolvin
Copy link
Member

great, thanks.

@PrettyWood PrettyWood deleted the fix/modify_schema branch June 27, 2020 14:04
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.

Possible regression of __modify_schema__ on master
3 participants