Skip to content

Commit 087bbeb

Browse files
committed
removed unused function
1 parent ff760d1 commit 087bbeb

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

sentry_sdk/integrations/openai_agents/patches/runner.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
import sentry_sdk
66

7-
from ..spans import (
8-
agent_workflow_span,
9-
update_agent_workflow_span,
10-
)
7+
from ..spans import agent_workflow_span
118
from ..utils import _capture_exception
129

1310
from typing import TYPE_CHECKING
@@ -27,7 +24,7 @@ def _create_run_wrapper(original_func):
2724
async def async_wrapper(*args, **kwargs):
2825
# type: (*Any, **Any) -> Any
2926
agent = args[0]
30-
with agent_workflow_span(agent) as span:
27+
with agent_workflow_span(agent):
3128
result = None
3229
try:
3330
result = await original_func(*args, **kwargs)
@@ -41,8 +38,6 @@ async def async_wrapper(*args, **kwargs):
4138
current_span.__exit__(None, None, None)
4239

4340
raise exc from None
44-
finally:
45-
update_agent_workflow_span(span, agent, result)
4641

4742
@wraps(original_func)
4843
def sync_wrapper(*args, **kwargs):

sentry_sdk/integrations/openai_agents/spans/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
from .agent_workflow import ( # noqa: F401
2-
agent_workflow_span,
3-
update_agent_workflow_span,
4-
)
1+
from .agent_workflow import agent_workflow_span # noqa: F401
52
from .ai_client import ai_client_span, update_ai_client_span # noqa: F401
63
from .execute_tool import execute_tool_span, update_execute_tool_span # noqa: F401
74
from .handoff import handoff_span # noqa: F401

sentry_sdk/integrations/openai_agents/spans/agent_workflow.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
from typing import TYPE_CHECKING
77

88
if TYPE_CHECKING:
9-
from agents import Agent
10-
from typing import Any
9+
import agents
1110

1211

1312
def agent_workflow_span(agent):
14-
# type: (Agent) -> sentry_sdk.tracing.Span
13+
# type: (agents.Agent) -> sentry_sdk.tracing.Span
1514

1615
# Create a transaction or a span if an transaction is already active
1716
span = _get_start_span_function()(
@@ -20,8 +19,3 @@ def agent_workflow_span(agent):
2019
)
2120

2221
return span
23-
24-
25-
def update_agent_workflow_span(span, agent, result):
26-
# type: (sentry_sdk.tracing.Span, Agent, Any) -> None
27-
pass

0 commit comments

Comments
 (0)