Closed
Description
Expected Behaviour
Contrarily to what is stated in the documentation, since the version 3 (and more precisely the pull request #4502) , it is not possible anymore to import any Pydantic module/function through aws_lambda_powertools.utilities.parser.pydantic
.
In my case, I would like to be able to import the decorator @field_serializer
Current Behaviour
python -c "from aws_lambda_powertools.utilities.parser.pydantic import field_serializer"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'aws_lambda_powertools.utilities.parser.pydantic'
Code snippet
python3 -m venv venv
source venv/bin/activate
pip install aws-lambda-powertools[all]==3.1.0
python -c "from aws_lambda_powertools.utilities.parser.pydantic import field_serializer"
Possible Solution
- Restore the file
aws_lambda_powertools/utilities/parser/pydantic.py
removed in feat(parser): Allow primitive data types to be parsed using TypeAdapter #4502 - Correct the documentation
Steps to Reproduce
Execute the following code snippet
python3 -m venv venv
source venv/bin/activate
pip install aws-lambda-powertools[all]==3.1.0
python -c "from aws_lambda_powertools.utilities.parser.pydantic import field_serializer"
Powertools for AWS Lambda (Python) version
3.1.0
AWS Lambda function runtime
3.12
Packaging format used
PyPi
Debugging logs
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Closed