Skip to content

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

@pydantic-hooky pydantic-hooky bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Sep 26, 2023
@pydantic-hooky pydantic-hooky bot assigned zakstucke and unassigned hramezani Sep 26, 2023
@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
Contributor

@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
Contributor

@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
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