Skip to content

Commit

Permalink
fix(metrics): explicit type to single_metric ctx manager (#865)
Browse files Browse the repository at this point in the history
Co-authored-by: Heitor Lessa <[email protected]>
  • Loading branch information
whardier and heitorlessa authored Dec 8, 2021
1 parent 967f63b commit e1927d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aws_lambda_powertools/metrics/metric.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import logging
from contextlib import contextmanager
from typing import Dict, Optional, Union
from typing import Dict, Optional, Union, Generator

from .base import MetricManager, MetricUnit

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


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

0 comments on commit e1927d5

Please sign in to comment.