-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Current field value is not displayed in after field validator #8126
Current field value is not displayed in after field validator #8126
Comments
Hi @MaxHalford, Thanks for reporting this. This does look like a bug. I'm guessing it might be on the |
My bad: I didn't take the time to think if this pertained to Have a good weekend! |
@MaxHalford, no worries at all! Thanks for bringing the issue to our attention 😄. |
any news on this issue? |
So I've identified why the result happens as it does, and I've opened pydantic/pydantic-core#1278 which would create the behaviour suggested here. I need to reflect further on what the repercussions of that change might be. |
Initial Checks
Description
I have a before field validator which populates a field based on another field. I then have an after field validator which checks the obtained value. The resolution order of these validators is correct. The issue I see is that in the error message, the
input_value
displays the current value of the field, it instead displays what I assume is the starting value.This isn't a blocking issue. But I believe modifying the message to display the current value of the field would be more useful.
I'm happy to provide more details if needed :)
Example Code
Here's the MRE:
Here's the exception:
As you can see, the
input_value
isNone
and not -32.0. This is what I would expect:Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: