generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 455
Closed as not planned
Labels
bugSomething isn't workingSomething isn't workingtypingStatic typing definition related issues (mypy, pyright, etc.)Static typing definition related issues (mypy, pyright, etc.)
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
Labels
bugSomething isn't workingSomething isn't workingtypingStatic typing definition related issues (mypy, pyright, etc.)Static typing definition related issues (mypy, pyright, etc.)
Type
Projects
Status
Closed