-
Notifications
You must be signed in to change notification settings - Fork 421
chore(deps): remove email-validator; use Str over EmailStr in SES model #1608
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
chore(deps): remove email-validator; use Str over EmailStr in SES model #1608
Conversation
dd7138c
to
8a49b7f
Compare
8a49b7f
to
32d5d05
Compare
Codecov ReportBase: 99.38% // Head: 99.40% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## v2 #1608 +/- ##
==========================================
+ Coverage 99.38% 99.40% +0.01%
==========================================
Files 125 127 +2
Lines 5731 5836 +105
Branches 359 367 +8
==========================================
+ Hits 5696 5801 +105
+ Misses 18 17 -1
- Partials 17 18 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -21,7 +20,7 @@ class SesReceiptAction(BaseModel): | |||
class SesReceipt(BaseModel): | |||
timestamp: datetime | |||
processingTimeMillis: PositiveInt | |||
recipients: List[EmailStr] | |||
recipients: List[str] |
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.
Hey @rubenfonseca @heitorlessa , that's a breaking change. users are expecting here proper email address validation.
I think a better solution would be:
- During import try to import EmailStr, if there's an except redefine the type as str
- add docs and specify that for Ses model, you should install the extra dependency
WDYT?
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.
Hi @ran-isenberg , we hear you and appreciate your feedback. We’re including this change in V2 to not impact customers in any shape or form.
To add to my comment earlier, as helpful as e-mail validator may be for an untrusted payload, this is not the case for SES. It would, however, for something like “body” in API Gateway.
I’ll update the issue linked with this and related Pydantic overhead that are making us more cautious on double validation.
Issue number: #1607
Summary
Changes
Removes
email-validator
from the extra group dependencies.User experience
This will also reduce the total Lambda Layer and SAR app size.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.