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

Added validation_error_cause to config. #7626

Merged
merged 4 commits into from Oct 27, 2023
Merged

Added validation_error_cause to config. #7626

merged 4 commits into from Oct 27, 2023

Conversation

zakstucke
Copy link
Contributor

@zakstucke zakstucke commented Sep 26, 2023

Change Summary

Hooks up validation_error_cause: bool config value added to pydantic core.

Related issue number

Fix #6498

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @hramezani

@zakstucke
Copy link
Contributor Author

please review

@hramezani
Copy link
Member

Thanks @zakstucke for this patch 🙏

It would be great to have at least one test for this config flag.

Please update

@zakstucke
Copy link
Contributor Author

zakstucke commented Sep 26, 2023

@hramezani its got quite a few different pathways tested fully in pydantic core. Do you want me to add exception group as a test dep in pydantic as well and test all the different pathways, or something simpler?

Pathways:

  • Disabled, nothing
  • <3.11, enabled no backport -> ImportError with msg to install backport
  • <3.11 with backport -> works using UserWarning
  • =>3.11 with/without backport -> works using notes

@hramezani
Copy link
Member

@zakstucke I am thinking about having only the last option(=>3.11 with/without backport -> works using notes) because the other cases are tested already in pydantic-core. But let's see what is @samuelcolvin idea here.

@zakstucke
Copy link
Contributor Author

zakstucke commented Sep 26, 2023

@hramezani ok sounds good, just added test for 3.11 modern pathway, disabled and enabled.

Please review

@zakstucke
Copy link
Contributor Author

@hramezani

@hramezani
Copy link
Member

Thanks @zakstucke for refreshing the PR, we will include this in the next release

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks @zakstucke for the contribution 😄

@sydney-runkle
Copy link
Member

@zakstucke, do you want to change the description of this PR to have Fix #6498? instead of just the issue reference?

@zakstucke
Copy link
Contributor Author

@sydney-runkle done! (If I understood you correctly)

@sydney-runkle sydney-runkle merged commit e4953e8 into pydantic:main Oct 27, 2023
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

raise Err() from e and e.add_note() lose information in validation errors
3 participants