Open
Description
Expected Behaviour
No mypy error when using from aws_lambda_powertools.utilities.parser import parse
function with SQSEnveloppe.
Since SQS payload returns a list of events, the return type could be a list of my model.
Current Behaviour
Mypy returns an error since there's no overload for the function from aws_lambda_powertools.utilities.parser import parse
where the return type is List[T]
.
I've to use type: ignore
Code snippet
my_events: list[MyClass] = parse(
events, model=MyClass, envelope=envelopes.SqsEnvelope # type: ignore
)
Possible Solution
Add overload with return type List[T] for function parse
Steps to Reproduce
Use parse function with a pydantic model and SQSEnveloppe.
Run mypy
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.9
Packaging format used
PyPi
Debugging logs
Thanks for the repo, it's great !
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog