Skip to content

Bug: aws_lambda_powertools.utilities.parser.pydantic does not exist anymore while mentioned in the documentation #5390

Closed
@VladimirSvoboda

Description

@VladimirSvoboda

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

  1. Restore the file aws_lambda_powertools/utilities/parser/pydantic.py removed in feat(parser): Allow primitive data types to be parsed using TypeAdapter #4502
  2. 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

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions