Skip to content

Commit ad919a0

Browse files
author
Andrew Xue
committed
fix lint
1 parent bc6cb32 commit ad919a0

File tree

1 file changed

+11
-15
lines changed
  • opentelemetry-sdk/src/opentelemetry/sdk/trace

1 file changed

+11
-15
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py

+11-15
Original file line numberDiff line numberDiff line change
@@ -204,30 +204,25 @@ def _is_valid_attribute_value(value: types.AttributeValue) -> bool:
204204

205205
if first_element_type not in VALID_ATTR_VALUE_TYPES:
206206
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],
214210
)
215211
return False
216212

217213
for element in list(value)[1:]:
218214
if not isinstance(element, first_element_type):
219215
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__,
223219
)
224220
return False
225221
elif not isinstance(value, VALID_ATTR_VALUE_TYPES):
226222
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],
231226
)
232227
return False
233228
return True
@@ -427,7 +422,8 @@ def set_attribute(self, key: str, value: types.AttributeValue) -> None:
427422
with self._lock:
428423
self.attributes[key] = value
429424

430-
def _filter_attribute_values(self, attributes: types.Attributes):
425+
@staticmethod
426+
def _filter_attribute_values(attributes: types.Attributes):
431427
if attributes:
432428
for attr_key, attr_value in list(attributes.items()):
433429
if _is_valid_attribute_value(attr_value):

0 commit comments

Comments
 (0)