-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add enum error type #751
Add enum error type #751
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #751 +/- ##
==========================================
- Coverage 93.64% 93.64% -0.01%
==========================================
Files 99 99
Lines 13929 13933 +4
Branches 25 25
==========================================
+ Hits 13044 13047 +3
- Misses 879 880 +1
Partials 6 6
Continue to review full report in Codecov by Sentry.
|
CodSpeed Performance ReportMerging #751 will not alter performancesComparing Summary
|
please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to include it at tests/serializers/test_any.py:381
(The test_num
function)?
src/errors/types.rs
Outdated
@@ -159,6 +159,11 @@ pub enum ErrorType { | |||
pattern: String, | |||
}, | |||
// --------------------- | |||
// enum errors | |||
Enum { | |||
options: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once merged, I suppose this will be used to replace https://github.com/pydantic/pydantic/blob/b685d64c38f1d7abb3ed37bd30710b3e420dc86a/pydantic/_internal/_std_types_schema.py#L83 with a PydanticKnownError
?
Is there a reason why you chose options
here instead of expected
from that line? I see expected
is also used in other places in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about this.
Thanks for mentioning this. I've changed them to expected
No, I think this is related to validation |
Related to pydantic/pydantic#6439
The documentation PR in pydantic needs this error type to be added to
pydantic-core
Selected Reviewer: @dmontagu