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 02b0053
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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,8 +553,8 @@ def __init__(self,
)
self._kwargs['buckets'] = buckets

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

0 comments on commit 02b0053

Please sign in to comment.