-
-
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
Fix EmailStr for Cython #1126
Fix EmailStr for Cython #1126
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1126 +/- ##
======================================
Coverage 100% 100%
======================================
Files 20 20
Lines 3431 3433 +2
Branches 663 664 +1
======================================
+ Hits 3431 3433 +2
Continue to review full report at Codecov.
|
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.
Looks good, could you please also fix NameEmail
and add a test for that too.
yield str_validator | ||
yield cls.validate | ||
|
||
@classmethod | ||
def validate(cls, value: str) -> 'NameEmail': | ||
def validate(cls, value: Any) -> 'NameEmail': | ||
if type(value) == cls: | ||
return value | ||
value = str_validator(value) | ||
return cls(*validate_email(value)) |
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.
Looks good, could you please also fix NameEmail and add a test for that too.
I found a bug that the validator can't parse NameEmail
.
It means NameEmail
filed doesn't accept an instance of NameEmail
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
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.
sorry, just a few small things. Otherwise LGTM.
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
great thank you. |
* Fix EmailStr for Cython * add a change document. * Fix NameEmail * Update changes/1126-koxudaxi.md Co-Authored-By: Samuel Colvin <samcolvin@gmail.com> * Update pydantic/networks.py Co-Authored-By: Samuel Colvin <samcolvin@gmail.com> * Update changes/1126-koxudaxi.md Co-Authored-By: Samuel Colvin <samcolvin@gmail.com> * Update pydantic/networks.py Co-Authored-By: Samuel Colvin <samcolvin@gmail.com> Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Change Summary
This PR fixes EmailStr which is in Compiled Pydantic binary.
Related issue number
#1070
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)