@@ -232,7 +232,7 @@ class HistogramMetricFamily(Metric):
232
232
def __init__ (self ,
233
233
name : str ,
234
234
documentation : str ,
235
- buckets : Optional [Sequence [Tuple [str , float , Optional [ Exemplar ]]]] = None ,
235
+ buckets : Optional [Sequence [Union [ Tuple [str , float ], Tuple [ str , float , Exemplar ]]]] = None ,
236
236
sum_value : Optional [Union [int , float ]] = None ,
237
237
labels : Optional [Sequence [str ]] = None ,
238
238
unit : str = '' ,
@@ -250,7 +250,7 @@ def __init__(self,
250
250
251
251
def add_metric (self ,
252
252
labels : Sequence [str ],
253
- buckets : Sequence [Tuple [str , float , Optional [ Exemplar ]]],
253
+ buckets : Sequence [Union [ Tuple [str , float ], Tuple [ str , float , Exemplar ]]],
254
254
sum_value : Optional [Union [int , float ]],
255
255
timestamp : Optional [Union [Timestamp , float ]] = None ) -> None :
256
256
"""Add a metric to the metric family.
@@ -267,7 +267,7 @@ def add_metric(self,
267
267
bucket , value = b [:2 ]
268
268
exemplar = None
269
269
if len (b ) == 3 :
270
- exemplar = b [2 ]
270
+ exemplar = b [2 ] # type: ignore
271
271
self .samples .append (Sample (
272
272
self .name + '_bucket' ,
273
273
dict (list (zip (self ._labelnames , labels )) + [('le' , bucket )]),
0 commit comments