Closed aminalaee closed 1 month ago
Thanks for opening your first issue here! We'll come back to you as soon as we can. In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
Does that make sense to create a PR for this? Or is too broad of a type? I will create a small PR anyway.
Hello @aminalaee! I don't think that's too broad of a type. By definition lambda_handler
is an event and a context, but you can add more parameters or even *args, **kwargs because you need to inject some dependencies into your tests or any other use case. So I think it's ok to change the function signature.
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Static type checker used
pyright/pylance
AWS Lambda function runtime
3.12
Powertools for AWS Lambda (Python) version
latest
Static type checker info
Code snippet
Possible Solution
When using the
tracer.capture_lambda_handler
decorator withevent_source
decorator Pylance is complaining about type mismatch. Checking thelogger.inject_lambda_context
I think we could useAnyCallableT
.Does that make sense to create a PR for this? Or is too broad of a type? I will create a small PR anyway.