@@ -236,7 +236,7 @@ class Measurement(object):
236236 _cached = attr .ib (type = Optional [Dict [Text , Any ]], default = None )
237237
238238 def __attrs_pre_init__ (self , name : Text , * args : Any , ** kwargs : Any ) -> None :
239- del (args , kwargs )
239+ del (args , kwargs ) # pyrefly: ignore[unsupported-delete]
240240 if name in _RESERVED_MEASUREMENT_NAMES :
241241 raise ReservedMeasurementNameError (
242242 f'Measurement name { name } is reserved for internal use.'
@@ -308,7 +308,7 @@ def set_notification_callback(
308308 """Set the notifier we'll call when measurements are set."""
309309 self ._notification_cb = notification_cb
310310 if not notification_cb and self .dimensions :
311- self ._measured_value .notify_value_set = None
311+ self ._measured_value .notify_value_set = None # pyrefly: ignore[missing-attribute]
312312 return self
313313
314314 def notify_value_set (self ) -> None :
@@ -495,7 +495,7 @@ def to_dataframe(self, columns: Any = None) -> Any:
495495 'Only a dimensioned measurement can be converted to a DataFrame' )
496496
497497 if columns is None :
498- columns = [d .name for d in self .dimensions ]
498+ columns = [d .name for d in self .dimensions ] # pyrefly: ignore[not-iterable]
499499 columns += [self .units .name if self .units else 'value' ]
500500
501501 dataframe = self ._measured_value .to_dataframe (columns )
@@ -518,7 +518,7 @@ def from_dataframe(self, dataframe: Any, metric_column: str) -> None:
518518 raise TypeError (
519519 'Only a dimensioned measurement can be set from a DataFrame'
520520 )
521- dimension_labels = [d .name for d in self .dimensions ]
521+ dimension_labels = [d .name for d in self .dimensions ] # pyrefly: ignore[not-iterable]
522522 dimensioned_df = dataframe .reset_index ()
523523 try :
524524 dimensioned_df .set_index (dimension_labels , inplace = True )
@@ -561,12 +561,12 @@ class MeasuredValue(object):
561561 def __str__ (self ) -> Text :
562562 return str (self .value ) if self .is_value_set else 'UNSET'
563563
564- def __eq__ (self , other : 'MeasuredValue' ) -> bool :
564+ def __eq__ (self , other : 'MeasuredValue' ) -> bool : # pyrefly: ignore[bad-override]
565565 return (type (self ) == type (other ) and self .name == other .name and # pylint: disable=unidiomatic-typecheck
566566 self .is_value_set == other .is_value_set
567567 and self .stored_value == other .stored_value )
568568
569- def __ne__ (self , other : 'MeasuredValue' ) -> bool :
569+ def __ne__ (self , other : 'MeasuredValue' ) -> bool : # pyrefly: ignore[bad-override]
570570 return not self .__eq__ (other )
571571
572572 @property
@@ -621,10 +621,10 @@ def __attrs_post_init__(self) -> None:
621621 'suffix' : self .suffix ,
622622 })
623623
624- def __eq__ (self , other : 'Dimension' ) -> bool :
624+ def __eq__ (self , other : 'Dimension' ) -> bool : # pyrefly: ignore[bad-override]
625625 return self .description == other .description and self .unit == other .unit
626626
627- def __ne__ (self , other : 'Dimension' ) -> bool :
627+ def __ne__ (self , other : 'Dimension' ) -> bool : # pyrefly: ignore[bad-override]
628628 return not self == other
629629
630630 def __repr__ (self ) -> Text :
@@ -633,17 +633,17 @@ def __repr__(self) -> Text:
633633 @classmethod
634634 def from_unit_descriptor (cls ,
635635 unit_desc : util_units .UnitDescriptor ) -> 'Dimension' :
636- return cls (unit = unit_desc )
636+ return cls (unit = unit_desc ) # pyrefly: ignore[unexpected-keyword]
637637
638638 @classmethod
639639 def from_string (cls , string : Text ) -> 'Dimension' :
640640 """Convert a string into a Dimension."""
641641 # Note: There is some ambiguity as to whether the string passed is intended
642642 # to become a unit looked up by name or suffix, or a Dimension descriptor.
643643 if string in util_units .UNITS_BY_ALL :
644- return cls (description = string , unit = util_units .Unit (string ))
644+ return cls (description = string , unit = util_units .Unit (string )) # pyrefly: ignore[unexpected-keyword]
645645 else :
646- return cls (description = string )
646+ return cls (description = string ) # pyrefly: ignore[unexpected-keyword]
647647
648648 @property
649649 def description (self ) -> Text :
@@ -729,7 +729,7 @@ def __setitem__(self, coordinates: Any, value: Any) -> None:
729729 _LOG .warning (
730730 'Overriding previous measurement %s[%s] value of %s with %s' ,
731731 self .name , coordinates , self .value_dict [coordinates ], value )
732- self ._cached_basetype_values = None
732+ self ._cached_basetype_values = None # pyrefly: ignore[bad-assignment]
733733 elif self ._cached_basetype_values is not None :
734734 self ._cached_basetype_values .append (
735735 data .convert_to_base_types (coordinates + (value ,)))
@@ -774,7 +774,7 @@ def value(self) -> List[Any]:
774774
775775 def basetype_value (self ) -> List [Any ]:
776776 if self ._cached_basetype_values is None :
777- self ._cached_basetype_values = list (
777+ self ._cached_basetype_values = list ( # pyrefly: ignore[bad-assignment]
778778 data .convert_to_base_types (coordinates + (value ,))
779779 for coordinates , value in self .value_dict .items ())
780780 return self ._cached_basetype_values
0 commit comments