-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency file
Description
Expected Behaviour
Deprecated APIs should not be used.
Current Behaviour
/path/to/my/project/.venv/lib/python3.12/site-packages/pydantic/main.py:1132: PydanticDeprecatedSince20: The `parse_obj` method is deprecated; use `model_validate` instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.8/migration/
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
Code snippet
from aws_lambda_powertools.utilities.parser import event_parser
from aws_lambda_powertools.utilities.typing import LambdaContext
from pydantic import BaseModel
class Ping(BaseModel):
message: str
@event_parser(model=Ping)
def lambda_handler(event: Ping, _: LambdaContext) -> None:
print(event.message)
Possible Solution
Update aws_lambda_powertools internals to use model_validate
rather than parse_obj
if Pydantic v2 is in use.
Steps to Reproduce
N/A
Powertools for AWS Lambda (Python) version
aws_lambda_powertools-2.43.1-py3-none-any.whl sha256:48116250c1771c7b8d4977ad2d475271074d86964107ccfd3fc6775e51984d88
AWS Lambda function runtime
3.12
Packaging format used
Lambda Layers
Debugging logs
No response
Metadata
Metadata
Assignees
Labels
dependenciesPull requests that update a dependency filePull requests that update a dependency file
Type
Projects
Status
Closed