Skip to content

Commit

Permalink
Fix _otel lint
Browse files Browse the repository at this point in the history
Technically, `span.otel_span` can be None, which is not accepted by
`trace.use_span`.
  • Loading branch information
pquentin committed Oct 14, 2024
1 parent de2fbd4 commit a716c60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elasticsearch_serverless/_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan, None, Non

@contextlib.contextmanager
def use_span(self, span: OpenTelemetrySpan) -> Generator[None, None, None]:
if not self.enabled or self.tracer is None:
if not self.enabled or self.tracer is None or span.otel_span is None:
yield
return

Expand Down

0 comments on commit a716c60

Please sign in to comment.