-
Notifications
You must be signed in to change notification settings - Fork 428
Maintenance: Remove email-validator dependency for v2 #1607
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
Comments
@rubenfonseca i think this removal will break the parser SES model that expect this depedancy during import. from pydantic.networks import EmailStr is 400KB really that big of a deal? |
Hi @ran-isenberg! Thanks for your feedback! We thought about the cost-benefit of adding an extra dependency to validate something that is sent by AWS, and that the user (AFAIK) has little to no control. We believe it's not worth it and we could use a simple string validation instead. 400KB might not seem a very big deal, but currently is twice the size of Powertools :) We could do a lot more with that space! I also just update the PR to remove the dependency you mentioned during the import, so hopefully no crashes during import :) |
linking the original issue by @huonw #998 and linking Pydantic ~330ms overhead at cold start (largely due to reflection; it's expected to get a lot better in Pydantic V2): #1164 (comment) |
Closing as we're wrap to launch V2 |
|
Summary
We should remove the
email-validator
dependency from the v2 Lambda Layer and SAR.Why is this needed?
As we try to reduce the size of our v2 layer, we noticed that the email-validator is only needed if you use the pydantic's
EmailStr
validator.Currently, adding
email-validator
adds ~400KB to our compressed layer size.Which area does this relate to?
Validation
Solution
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: