Skip to content

Static typing: Argument missing for parameter "context" when using @tracer.capture_lambda_handler(capture_response=False) #6188

@tiagohconte

Description

@tiagohconte

Static type checker used

pyright/pylance

AWS Lambda function runtime

3.11

Powertools for AWS Lambda (Python) version

3.6.0

Static type checker info

Argument missing for parameter "context"

The issue only happens when there is any parameter set in capture_lambda_handler.

Code snippet

@logger.inject_lambda_context(log_event=True)
@tracer.capture_lambda_handler(capture_response=False)
def handle(event, context: LambdaContext) -> dict:
    return app.resolve(event, context)

Possible Solution

May be related to #4088 and #4795

Metadata

Metadata

Assignees

Labels

typingStatic typing definition related issues (mypy, pyright, etc.)

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions