Skip to content

Commit dcb44f0

Browse files
committed
More typing fixes for py38 and py39
1 parent 74016f0 commit dcb44f0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/exemplar/exemplar_reservoir.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from abc import ABC, abstractmethod
1616
from random import randrange
17-
from typing import Any, Callable, Optional, Sequence, Union
17+
from typing import Any, Callable, Dict, List, Optional, Sequence, Union
1818

1919
from opentelemetry import trace
2020
from opentelemetry.context import Context
@@ -55,7 +55,7 @@ def offer(
5555
raise NotImplementedError("ExemplarReservoir.offer is not implemented")
5656

5757
@abstractmethod
58-
def collect(self, point_attributes: Attributes) -> list[Exemplar]:
58+
def collect(self, point_attributes: Attributes) -> List[Exemplar]:
5959
"""Returns accumulated Exemplars and also resets the reservoir for the next
6060
sampling period
6161
@@ -155,11 +155,11 @@ class FixedSizeExemplarReservoirABC(ExemplarReservoir):
155155
def __init__(self, size: int, **kwargs) -> None:
156156
super().__init__(**kwargs)
157157
self._size: int = size
158-
self._reservoir_storage: list[ExemplarBucket] = [
158+
self._reservoir_storage: List[ExemplarBucket] = [
159159
ExemplarBucket() for _ in range(self._size)
160160
]
161161

162-
def collect(self, point_attributes: Attributes) -> list[Exemplar]:
162+
def collect(self, point_attributes: Attributes) -> List[Exemplar]:
163163
"""Returns accumulated Exemplars and also resets the reservoir for the next
164164
sampling period
165165
@@ -313,7 +313,7 @@ def _find_bucket_index(
313313
return len(self._boundaries)
314314

315315

316-
ExemplarReservoirBuilder = Callable[[dict[str, Any]], ExemplarReservoir]
316+
ExemplarReservoirBuilder = Callable[[Dict[str, Any]], ExemplarReservoir]
317317
ExemplarReservoirBuilder.__doc__ = """ExemplarReservoir builder.
318318
319319
It may receive the Aggregation parameters it is bounded to; e.g.

0 commit comments

Comments
 (0)