Skip to content

Commit e1927d5

Browse files
fix(metrics): explicit type to single_metric ctx manager (aws-powertools#865)
Co-authored-by: Heitor Lessa <[email protected]>
1 parent 967f63b commit e1927d5

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)