Skip to content

Commit 81825b6

Browse files
tonalclaude
andcommitted
fix(aiomysql): Use record_sql_queries_supporting_streaming
Replace record_sql_queries with record_sql_queries_supporting_streaming to support span streaming (addresses sentry bot review comment). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 93a0de6 commit 81825b6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

sentry_sdk/integrations/aiomysql.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
import sentry_sdk
77
from sentry_sdk.consts import OP, SPANDATA
88
from sentry_sdk.integrations import _check_minimum_version, Integration, DidNotEnable
9-
from sentry_sdk.tracing_utils import add_query_source, record_sql_queries
9+
from sentry_sdk.tracing_utils import (
10+
add_query_source,
11+
record_sql_queries_supporting_streaming,
12+
)
1013
from sentry_sdk.utils import (
1114
capture_internal_exceptions,
1215
parse_version,
@@ -80,7 +83,7 @@ async def _inner(*args: Any, **kwargs: Any) -> T:
8083
params_list = params if integration and integration._record_params else None
8184
param_style = "pyformat" if params_list else None
8285

83-
with record_sql_queries(
86+
with record_sql_queries_supporting_streaming(
8487
cursor=None,
8588
query=query_str,
8689
params_list=params_list,
@@ -123,7 +126,7 @@ async def _inner(*args: Any, **kwargs: Any) -> T:
123126
# Prevent double-recording: _do_execute_many calls self.execute internally
124127
cursor._sentry_skip_next_execute = True
125128
try:
126-
with record_sql_queries(
129+
with record_sql_queries_supporting_streaming(
127130
cursor=None,
128131
query=query_str,
129132
params_list=params_list,

0 commit comments

Comments
 (0)