@@ -204,30 +204,25 @@ def _is_valid_attribute_value(value: types.AttributeValue) -> bool:
204
204
205
205
if first_element_type not in VALID_ATTR_VALUE_TYPES :
206
206
logger .warning (
207
- "Invalid type {} in attribute value sequence. Expected one of {} or a sequence of those types" .format (
208
- first_element_type .__name__ ,
209
- [
210
- valid_type .__name__
211
- for valid_type in VALID_ATTR_VALUE_TYPES
212
- ],
213
- )
207
+ "Invalid type %s in attribute value sequence. Expected one of %s or a sequence of those types" ,
208
+ first_element_type .__name__ ,
209
+ [valid_type .__name__ for valid_type in VALID_ATTR_VALUE_TYPES ],
214
210
)
215
211
return False
216
212
217
213
for element in list (value )[1 :]:
218
214
if not isinstance (element , first_element_type ):
219
215
logger .warning (
220
- "Mixed types {} and {} in attribute value sequence" . format (
221
- first_element_type .__name__ , type ( element ). __name__
222
- )
216
+ "Mixed types %s and %s in attribute value sequence" ,
217
+ first_element_type .__name__ ,
218
+ type ( element ). __name__ ,
223
219
)
224
220
return False
225
221
elif not isinstance (value , VALID_ATTR_VALUE_TYPES ):
226
222
logger .warning (
227
- "Invalid type {} for attribute value. Expected one of {} or a sequence of those types" .format (
228
- type (value ).__name__ ,
229
- [valid_type .__name__ for valid_type in VALID_ATTR_VALUE_TYPES ],
230
- )
223
+ "Invalid type %s for attribute value. Expected one of %s or a sequence of those types" ,
224
+ type (value ).__name__ ,
225
+ [valid_type .__name__ for valid_type in VALID_ATTR_VALUE_TYPES ],
231
226
)
232
227
return False
233
228
return True
@@ -427,7 +422,8 @@ def set_attribute(self, key: str, value: types.AttributeValue) -> None:
427
422
with self ._lock :
428
423
self .attributes [key ] = value
429
424
430
- def _filter_attribute_values (self , attributes : types .Attributes ):
425
+ @staticmethod
426
+ def _filter_attribute_values (attributes : types .Attributes ):
431
427
if attributes :
432
428
for attr_key , attr_value in list (attributes .items ()):
433
429
if _is_valid_attribute_value (attr_value ):
0 commit comments