-
Notifications
You must be signed in to change notification settings - Fork 420
Bug: Pydantic is being imported when using Event Handler without validation #3370
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
Working at this now |
7 tasks
7 tasks
|
This is now released under 2.28.0 version! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behaviour
I'm using
ApiGatewayResolver
without enabling validation and it shouldn't import Pydantic. Even if a customer has Pydantic installed, they should not import Pydantic without explicitly enabling validation:app = ApiGatewayResolver(enable_validation=True)
Current Behaviour
Profiling the application with tuna, I can see Pydantic being imported:
Code snippet
Possible Solution
Move these imports to an standalone file or import them only when enable_validation is True.
Steps to Reproduce
1 - Create a file
2 - pip install aws-lambda-powertools[all] tuna
3 - Use the code snippet provided
4 - python -X importtime test.py 2> prof1.log
5 - tuna prof1.log
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.11
Packaging format used
PyPi
Debugging logs
No response
The text was updated successfully, but these errors were encountered: