Skip to content

Commit 0348bd6

Browse files
committed
* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python: fix(metrics): explicit type to single_metric ctx manager (aws-powertools#865)
2 parents d4c29b7 + e1927d5 commit 0348bd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_lambda_powertools/metrics/metric.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import logging
33
from contextlib import contextmanager
4-
from typing import Dict, Optional, Union
4+
from typing import Dict, Optional, Union, Generator
55

66
from .base import MetricManager, MetricUnit
77

@@ -61,7 +61,7 @@ def add_metric(self, name: str, unit: Union[MetricUnit, str], value: float) -> N
6161

6262

6363
@contextmanager
64-
def single_metric(name: str, unit: MetricUnit, value: float, namespace: Optional[str] = None):
64+
def single_metric(name: str, unit: MetricUnit, value: float, namespace: Optional[str] = None) -> Generator[SingleMetric, None, None]:
6565
"""Context manager to simplify creation of a single metric
6666
6767
Example

0 commit comments

Comments
 (0)