Closed leandrodamascena closed 9 months ago
Working at this now
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
This is now released under 2.28.0 version!
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