diff --git a/prometheus_client/metrics.py b/prometheus_client/metrics.py index ac16afed..c0500b6f 100644 --- a/prometheus_client/metrics.py +++ b/prometheus_client/metrics.py @@ -218,8 +218,7 @@ def _multi_samples(self): for suffix, sample_labels, value, timestamp, exemplar in metric._samples(): yield (suffix, dict(series_labels + list(sample_labels.items())), value, timestamp, exemplar) - def _child_samples(self): # pragma: no cover - # type: () -> Sequence[Tuple[str, Dict[str, str], float]] + def _child_samples(self) -> Sequence[Tuple[str, Dict[str, str], float]]: # pragma: no cover raise NotImplementedError('_child_samples() must be implemented by %r' % self) def _metric_init(self): # pragma: no cover diff --git a/prometheus_client/samples.py b/prometheus_client/samples.py index 84a6defe..87588388 100644 --- a/prometheus_client/samples.py +++ b/prometheus_client/samples.py @@ -1,5 +1,4 @@ -from collections import namedtuple -from typing import Mapping, NamedTuple, Optional, Sequence +from typing import Dict, NamedTuple, Optional class Timestamp: @@ -38,14 +37,14 @@ def __gt__(self, other): # a Timestamp object, or None. # Exemplar can be an Exemplar object, or None. class Exemplar(NamedTuple): - labels: Mapping[str, str] + labels: Dict[str, str] value: float timestamp: Optional[float] = None class Sample(NamedTuple): name: str - labels: Mapping[str, str] + labels: Dict[str, str] value: float timestamp: Optional[float] = None exemplar: Optional[Exemplar] = None