8000 fix: update all modified field values in `root_validator` when `validate_assignment` is on by PrettyWood · Pull Request #2119 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

fix: update all modified field values in root_validator when validate_assignment is on #2119

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

Conversation

PrettyWood
Copy link
Collaborator
@PrettyWood PrettyWood commented Nov 13, 2020

Change Summary

Following #1971 we now run root_validator on assignment when Config.validate_assignment is set.
But we still only updated the assigned field and not all concerned fields

ℹ️ Not really a regression but more a fix to #1972 in v1.7.0

Related issue number

closes #2116

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 Nov 13, 2020

Codecov Report

Merging #2119 (51ae3b3) into master (6853032) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #2119   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         4093      4093           
  Branches       823       823           
=========================================
  Hits          4093      4093           

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 6853032...51ae3b3. Read the comment docs.

@PrettyWood PrettyWood added the bug V1 Bug related to Pydantic V1.X label Nov 13, 2020
@PrettyWood
Copy link
Collaborator Author

@samuelcolvin I took the liberty to add the bug label to all the PRs that fix regressions from pydantic 1.7+ to help you see what could be added for a possible v1.7.3
If you don't like this please let me know.
If you do, I guess a better label should be found to differentiate a regular fix and a regression on the latest release

Co-authored-by: Arthur Pastel <arthur.pastel@gmail.com>
@samuelcolvin samuelcolvin merged commit 1a2791d into pydantic:master Nov 30, 2020
@PrettyWood PrettyWood mentioned this pull request Nov 30, 2020
6 tasks
samuelcolvin pushed a commit that referenced this pull request Nov 30, 2020
…ate_assignment` is on (#2119)

* fix: update all modified field values in `root_validator` when `validate_assignment` is on

closes #2116

* chore: update root_validator name

Co-authored-by: Arthur Pastel <arthur.pastel@gmail.com>

Co-authored-by: Arthur Pastel <arthur.pastel@gmail.com>
@PrettyWood PrettyWood deleted the fix/root-validator-assignment-update-all branch December 17, 2020 20:47
samuelcolvin added a commit that referenced this pull request Jan 1, 2021
* fix: ignore `__doc__` as valid private attribute (#2091)

closes #2090

* Fixes a regression where Enum fields would not propagate keyword arguments to the schema (#2109)

fix #2108

* Fix schema extra not being included when field type is Enum

* Code format

* More code format

* Add changes file

Co-authored-by: Ben Martineau <b.martineau@iwoca.co.uk>

* fix: update all modified field values in `root_validator` when `validate_assignment` is on (#2119)

* fix: update all modified field values in `root_validator` when `validate_assignment` is on

closes #2116

* chore: update root_validator name

Co-authored-by: Arthur Pastel <arthur.pastel@gmail.com>

Co-authored-by: Arthur Pastel <arthur.pastel@gmail.com>

* fix: support `underscore_attrs_are_private` with generic models (#2139)

closes #2138

* fix: set right default value for required (optional) fields (#2143)

closes #2142

* Fix #2111: support pickle for built-in dataclasses (#2114)

* 2111: support pickle for built-in dataclasses

* 2111: add changes

* 2111: simplify test

* return original name + handle similar names

* add additional check

* fix a misspell

* remove useless f-string

* cleanup test

Co-authored-by: Samuel Colvin <s@muelcolvin.com>

* uprev and add history

* tempoarily pin pip

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
Co-authored-by: Ben Martineau <bm424@cam.ac.uk>
Co-authored-by: Ben Martineau <b.martineau@iwoca.co.uk>
Co-authored-by: Arthur Pastel <arthur.pastel@gmail.com>
Co-authored-by: aimestereo <aimestereo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validate_assignment with side effect validators
3 participants
0