Skip to content

Commit dd2ba36

Browse files
committed
fixed ruff and typecheck
1 parent 84bc754 commit dd2ba36

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

instrumentation-genai/opentelemetry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
---
3737
"""
3838

39-
from typing import Any, Callable, Collection, Optional
39+
from typing import Any, Callable, Collection
4040

4141
from langchain_core.callbacks import BaseCallbackHandler # type: ignore
4242
from wrapt import wrap_function_wrapper # type: ignore

instrumentation-genai/opentelemetry-instrumentation-langchain/tests/test_span_manager.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def handler(self, tracer):
2828
(uuid.uuid4(), True), # Parent in spans
2929
],
3030
)
31-
3231
def test_create_span(
3332
self, handler, tracer, parent_run_id, parent_in_spans
3433
):
@@ -42,9 +41,7 @@ def test_create_span(
4241
# Setup parent if needed
4342
if parent_run_id is not None and parent_in_spans:
4443
parent_mock_span = unittest.mock.Mock(spec=Span)
45-
handler.spans[parent_run_id] = _SpanState(
46-
span=parent_mock_span
47-
)
44+
handler.spans[parent_run_id] = _SpanState(span=parent_mock_span)
4845

4946
with (
5047
unittest.mock.patch.object(
@@ -81,10 +78,7 @@ def test_create_span(
8178
)
8279
mock_set_span_in_context.assert_called_once_with(mock_span)
8380

84-
85-
def test_end_span(
86-
self, handler
87-
):
81+
def test_end_span(self, handler):
8882
# Arrange
8983
run_id = uuid.uuid4()
9084
mock_span = unittest.mock.Mock(spec=Span)
@@ -104,4 +98,4 @@ def test_end_span(
10498
mock_span.end.assert_called_once()
10599
child_mock_span.end.assert_called_once()
106100
assert run_id not in handler.spans
107-
assert child_run_id not in handler.spans
101+
assert child_run_id not in handler.spans

0 commit comments

Comments
 (0)