Skip to content

Commit 4c0a96f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 748ab2d commit 4c0a96f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

strawberry/extensions/tracing/opentelemetry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
)
1212

1313
from opentelemetry import trace
14-
from opentelemetry.trace import SpanKind
1514
from opentelemetry.semconv._incubating.attributes import graphql_attributes
15+
from opentelemetry.trace import SpanKind
1616

1717
from strawberry.extensions import LifecycleStep, SchemaExtension
1818
from strawberry.extensions.utils import get_path_from_info
@@ -95,7 +95,7 @@ def on_operation(self) -> Generator[None, None, None]:
9595
graphql_attributes.GRAPHQL_OPERATION_TYPE,
9696
graphql_attributes.GraphqlOperationTypeValues(
9797
self.execution_context.operation_type.value.lower()
98-
).value
98+
).value,
9999
)
100100

101101
self._span_holder[LifecycleStep.OPERATION].end()

tests/schema/extensions/test_opentelemetry.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
from unittest.mock import MagicMock
33

44
import pytest
5-
from opentelemetry.trace import SpanKind
65
from opentelemetry.semconv._incubating.attributes.graphql_attributes import (
76
GRAPHQL_DOCUMENT,
87
GRAPHQL_OPERATION_NAME,
98
GRAPHQL_OPERATION_TYPE,
109
GraphqlOperationTypeValues,
1110
)
11+
from opentelemetry.trace import SpanKind
1212
from pytest_mock import MockerFixture
1313

1414
import strawberry
@@ -170,9 +170,7 @@ def generate_trace(*args: str, **kwargs: Any):
170170
)
171171
# and the span's attributes
172172
tracers[0].set_attribute.assert_has_calls(
173-
[
174-
mocker.call(GRAPHQL_OPERATION_NAME, "Example")
175-
]
173+
[mocker.call(GRAPHQL_OPERATION_NAME, "Example")]
176174
)
177175

178176

0 commit comments

Comments
 (0)