Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
  • Loading branch information
Pliner committed Feb 1, 2022
1 parent 0551300 commit 3d4a632
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prometheus_client/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import time
import types
from typing import (
Any, Callable, Dict, Iterable, Optional, Sequence, Type, TypeVar,
Any, Callable, Dict, Iterable, Optional, Sequence, Type, TypeVar, Union,
)

from . import values # retain this import style for testability
Expand Down Expand Up @@ -538,7 +538,7 @@ def __init__(self,
unit: str = '',
registry: Optional[CollectorRegistry] = REGISTRY,
_labelvalues: Optional[Sequence[str]] = None,
buckets: Sequence[float] = DEFAULT_BUCKETS,
buckets: Sequence[Union[float, int, str]] = DEFAULT_BUCKETS,
):
self._prepare_buckets(buckets)
super().__init__(
Expand All @@ -553,7 +553,7 @@ def __init__(self,
)
self._kwargs['buckets'] = buckets

def _prepare_buckets(self, buckets: Sequence[float]) -> None:
def _prepare_buckets(self, buckets: Sequence[Union[float, int, str]]) -> None:
buckets = [float(b) for b in buckets]
if buckets != sorted(buckets):
# This is probably an error on the part of the user,
Expand Down

0 comments on commit 3d4a632

Please sign in to comment.