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

function-after: use input to function as source in error message #1278

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davidhewitt
Copy link
Contributor

Change Summary

Uses the output of the inner validator as the input in the error message for a function-after validator.

This might actually not be a desirable thing to change, so I'm opening this PR to see what CI and integration tests think before going further.

Related issue number

Fix pydantic/pydantic#8126

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Copy link

codspeed-hq bot commented Apr 23, 2024

CodSpeed Performance Report

Merging #1278 will not alter performance

Comparing dh/function-after-input (dc9007a) with main (1e5e899)

Summary

✅ 155 untouched benchmarks

@sydney-runkle
Copy link
Member

@davidhewitt, would you still like to keep this open as a draft?

@davidhewitt
Copy link
Contributor Author

We should discuss if this change should be done and either complete or close.

@sydney-runkle
Copy link
Member

cc @samuel, we can discuss at oss sync tomorrow.

@davidhewitt
Copy link
Contributor Author

It looks like the problem here is that models with before validators now output the intermediate state between the model validator and the model fields validator, I think we should be removing that split anyway for performance and handling validators a separate way ideally. So will leave this open with the intent to move forward after those are solved.

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.

Current field value is not displayed in after field validator
2 participants