Skip to content

Commit e8e23f4

Browse files
committed
Fix ruff
1 parent 273c442 commit e8e23f4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

opentelemetry-api/src/opentelemetry/attributes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def _clean_extended_attribute_value(
181181
return tuple(cleaned_seq)
182182

183183

184-
185184
def _clean_extended_attribute(
186185
key: str, value: types.AnyValue, max_len: Optional[int]
187186
) -> types.AnyValue:

opentelemetry-api/tests/attributes/test_attributes.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,27 +304,31 @@ def test_extended_attributes(self):
304304

305305
def test_wsgi_request_conversion_to_string(self):
306306
"""Test that WSGI request objects are converted to strings before calling _clean_extended_attribute."""
307-
307+
308308
class DummyWSGIRequest:
309309
def __str__(self):
310310
return "<DummyWSGIRequest method=GET path=/example/>"
311-
311+
312312
bdict = BoundedAttributes(extended_attributes=True, immutable=False)
313313
wsgi_request = DummyWSGIRequest()
314314
original_request = wsgi_request # Keep reference to original object
315-
315+
316316
with unittest.mock.patch(
317317
"opentelemetry.attributes._clean_extended_attribute",
318318
return_value="stringified_request",
319319
) as clean_extended_attribute_mock:
320320
bdict["request"] = wsgi_request
321-
321+
322322
# Verify that _clean_extended_attribute was called
323323
clean_extended_attribute_mock.assert_called_once()
324-
324+
325325
# Verify that the value passed to _clean_extended_attribute is a string, not the original object
326326
call_args = clean_extended_attribute_mock.call_args
327327
passed_value = call_args[0][1] # Second argument is the value
328328
self.assertIsInstance(passed_value, str)
329-
self.assertNotEqual(passed_value, original_request) # Should be stringified, not the original object
330-
self.assertIn("DummyWSGIRequest", passed_value) # String representation includes class name
329+
self.assertNotEqual(
330+
passed_value, original_request
331+
) # Should be stringified, not the original object
332+
self.assertIn(
333+
"DummyWSGIRequest", passed_value
334+
) # String representation includes class name

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/export/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131
ReadableLogRecord,
3232
ReadWriteLogRecord,
3333
)
34-
from opentelemetry.sdk._shared_internal import (
35-
BatchProcessor,
36-
DuplicateFilter,
37-
)
34+
from opentelemetry.sdk._shared_internal import BatchProcessor, DuplicateFilter
3835
from opentelemetry.sdk.environment_variables import (
3936
OTEL_BLRP_EXPORT_TIMEOUT,
4037
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,

0 commit comments

Comments
 (0)