Skip to content

MyPy error on @metrics.log_metrics(capture_cold_start_metric=True) #743

Closed
@michaelbrewer

Description

@michaelbrewer

What were you trying to accomplish?

Run MyPy linter on code:

from aws_lambda_powertools import Metrics

metrics = Metrics()

@metrics.log_metrics(capture_cold_start_metric=True)
def handler(event, context) -> Dict[str, str]:
    ...

Expected Behavior

No MyPy errors should be returned

Current Behavior

Mypy error Mypy: <nothing> not callable is returned on line @metrics.log_metrics(capture_cold_start_metric=True)

Possible Solution

Environment

  • Powertools version used: 1.21.0
  • Packaging format (Layers, PyPi): PyPi
  • AWS Lambda function runtime: Python 3.9
  • Debugging logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions