Skip to content

Commit dc2cd6d

Browse files
committed
more lint
1 parent b8e7e4e commit dc2cd6d

4 files changed

Lines changed: 3 additions & 22 deletions

File tree

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pylint==3.0.2
22
httpretty==1.1.4
3-
pyright==v1.1.408
3+
pyright==v1.1.404
44
sphinx==7.1.2
55
sphinx-rtd-theme==2.0.0rc4
66
sphinx-autodoc-typehints==1.25.2

util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,6 @@ class GenAIInvocation(ABC):
259259
start_workflow, start_tool) rather than constructing invocations directly.
260260
"""
261261

262-
@property
263-
def operation_name(self) -> str:
264-
return self._operation_name
265-
266262
def __init__(
267263
self,
268264
# Individual components instead of TelemetryHandler to avoid a circular

util/opentelemetry-util-genai/tests/test_handler_workflow.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ class TelemetryHandlerWorkflowTest(_WorkflowTestBase):
4747
# start_workflow
4848
# ------------------------------------------------------------------
4949

50-
def test_operation_name_is_readonly(self) -> None:
51-
invocation = self.handler.start_workflow(name="wf")
52-
with self.assertRaises(AttributeError):
53-
setattr(invocation, "operation_name", "foo_Bar")
54-
self.assertEqual(invocation.operation_name, "invoke_workflow")
55-
invocation.stop()
56-
5750
def test_start_workflow_creates_span(self) -> None:
5851
invocation = self.handler.start_workflow("my_workflow")
5952
self.assertIsNot(invocation.span, INVALID_SPAN)
@@ -182,7 +175,7 @@ def test_workflow_context_manager_default_invocation(self) -> None:
182175
with self.handler.workflow() as inv:
183176
self.assertIsInstance(inv, WorkflowInvocation)
184177
self.assertIsNone(inv.name)
185-
self.assertEqual(inv.operation_name, "invoke_workflow")
178+
self.assertEqual(inv._operation_name, "invoke_workflow")
186179

187180
spans = self._get_finished_spans()
188181
self.assertEqual(len(spans), 1)

util/opentelemetry-util-genai/tests/test_workflow_invocation.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import unittest
22

3-
import pytest
4-
53
from opentelemetry.sdk.trace import TracerProvider
64
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
75
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
@@ -29,7 +27,7 @@ def test_default_values(self):
2927
invocation = self.handler.start_workflow(None)
3028
invocation.stop()
3129
assert invocation.name is None
32-
assert invocation.operation_name == "invoke_workflow"
30+
assert invocation._operation_name == "invoke_workflow"
3331
assert not invocation.input_messages
3432
assert not invocation.output_messages
3533
assert invocation.span is not INVALID_SPAN
@@ -85,12 +83,6 @@ def test_default_attributes_are_independent(self):
8583
inv1.stop()
8684
inv2.stop()
8785

88-
def test_operation_name_is_readonly(self):
89-
invocation = self.handler.start_workflow("wf")
90-
with pytest.raises(AttributeError):
91-
setattr(invocation, "operation_name", "foo")
92-
invocation.stop()
93-
9486
def test_full_construction(self):
9587
inp = InputMessage(role="user", parts=[Text(content="query")])
9688
out = OutputMessage(

0 commit comments

Comments
 (0)