Skip to content

Commit 75c0cc1

Browse files
.
1 parent 9929f55 commit 75c0cc1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

sentry_sdk/tracing_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def record_sql_queries(
133133
executemany: bool,
134134
record_cursor_repr: bool = False,
135135
span_origin: str = "manual",
136-
) -> "Generator[sentry_sdk.tracing.Span, None, None]":
136+
) -> "Generator[Union[sentry_sdk.tracing.Span, sentry_sdk.traces.StreamedSpan], None, None]":
137137
# TODO: Bring back capturing of params by default
138138
client = sentry_sdk.get_client()
139139
if client.options["_experiments"].get("record_sql_params", False):
@@ -163,7 +163,7 @@ def record_sql_queries(
163163

164164
if has_span_streaming_enabled(client.options):
165165
with sentry_sdk.traces.start_span(
166-
name=query,
166+
name="<unknown SQL query>" if query is None else query,
167167
attributes={
168168
"sentry.origin": span_origin,
169169
"sentry.op": OP.DB,

tests/integrations/django/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def test_response_trace(sentry_init, client, capture_events, render_span_tree):
457457

458458
assert (
459459
'- op="view.response.render": description="serialize response"'
460-
in render_span_tree(events[0])
460+
in render_span_tree(events[0]["spans"], events[0]["contexts"]["trace"])
461461
)
462462

463463

0 commit comments

Comments
 (0)