Description
Static type checker used
pyright/pylance
AWS Lambda function runtime
3.11
Powertools for AWS Lambda (Python) version
latest
Static type checker info
# error: Argument missing for parameter "context" (reportGeneralTypeIssues)
Code snippet
@metrics.log_metrics(capture_cold_start_metric=True) # error: Argument missing for parameter "context" (reportGeneralTypeIssues)
def lambda_handler(event: dict, context: LambdaContext) -> dict:
return app.resolve(event, context)
Possible Solution
This is a known issue with pyright (see pyright#3265). See also this Discord discussion.
Metadata
Metadata
Assignees
Type
Projects
Status
Shipped
Activity
boring-cyborg commentedon Apr 8, 2024
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
[-]Static typing: TITLE[/-][+]Static typing: @metrics.log_metrics decorator[/+]rubenfonseca commentedon Apr 8, 2024
Confirmed I'm seeing this too. Added to the backlog. Thank you for opening this @ChrisHills463
hello_world/app.py
aws/aws-sam-cli-app-templates#499leandrodamascena commentedon Apr 8, 2024
I'm not sure if it's related (I haven't checked), but we recently had a small refactoring on some parts of this code:
https://github.com/aws-powertools/powertools-lambda-python/pull/3460/files#diff-49bfc9264b598c920d5bef978e668726dc09f7a8fc27f4aae974849ecab60ee2
16 remaining items