1414from sentry_sdk .consts import DEFAULT_MAX_VALUE_LENGTH , SPANDATA
1515from sentry_sdk .integrations .sqlalchemy import SqlalchemyIntegration
1616from sentry_sdk .serializer import MAX_EVENT_BYTES
17- from sentry_sdk .tracing_utils import record_sql_queries
17+ from sentry_sdk .tracing_utils import record_sql_queries_supporting_streaming
1818from sentry_sdk .utils import json_dumps
1919
2020
@@ -922,7 +922,9 @@ class Person(Base):
922922
923923 class fake_record_sql_queries : # noqa: N801
924924 def __init__ (self , * args , ** kwargs ):
925- with record_sql_queries (* args , ** kwargs ) as span :
925+ with record_sql_queries_supporting_streaming (
926+ * args , ** kwargs
927+ ) as span :
926928 self .span = span
927929
928930 if span_streaming :
@@ -939,7 +941,7 @@ def __exit__(self, type, value, traceback):
939941 pass
940942
941943 with mock .patch (
942- "sentry_sdk.integrations.sqlalchemy.record_sql_queries " ,
944+ "sentry_sdk.integrations.sqlalchemy.record_sql_queries_supporting_streaming " ,
943945 fake_record_sql_queries ,
944946 ):
945947 assert session .query (Person ).first () == bob
@@ -983,7 +985,9 @@ class Person(Base):
983985
984986 class fake_record_sql_queries : # noqa: N801
985987 def __init__ (self , * args , ** kwargs ):
986- with record_sql_queries (* args , ** kwargs ) as span :
988+ with record_sql_queries_supporting_streaming (
989+ * args , ** kwargs
990+ ) as span :
987991 self .span = span
988992
989993 if span_streaming :
@@ -1000,7 +1004,7 @@ def __exit__(self, type, value, traceback):
10001004 pass
10011005
10021006 with mock .patch (
1003- "sentry_sdk.integrations.sqlalchemy.record_sql_queries " ,
1007+ "sentry_sdk.integrations.sqlalchemy.record_sql_queries_supporting_streaming " ,
10041008 fake_record_sql_queries ,
10051009 ):
10061010 assert session .query (Person ).first () == bob
@@ -1061,7 +1065,9 @@ class Person(Base):
10611065
10621066 class fake_record_sql_queries : # noqa: N801
10631067 def __init__ (self , * args , ** kwargs ):
1064- with record_sql_queries (* args , ** kwargs ) as span :
1068+ with record_sql_queries_supporting_streaming (
1069+ * args , ** kwargs
1070+ ) as span :
10651071 self .span = span
10661072
10671073 self .span ._start_timestamp = datetime (2024 , 1 , 1 , microsecond = 0 )
@@ -1074,7 +1080,7 @@ def __exit__(self, type, value, traceback):
10741080 pass
10751081
10761082 with mock .patch (
1077- "sentry_sdk.integrations.sqlalchemy.record_sql_queries " ,
1083+ "sentry_sdk.integrations.sqlalchemy.record_sql_queries_supporting_streaming " ,
10781084 fake_record_sql_queries ,
10791085 ):
10801086 assert session .query (Person ).first () == bob
@@ -1131,7 +1137,9 @@ class Person(Base):
11311137
11321138 class fake_record_sql_queries : # noqa: N801
11331139 def __init__ (self , * args , ** kwargs ):
1134- with record_sql_queries (* args , ** kwargs ) as span :
1140+ with record_sql_queries_supporting_streaming (
1141+ * args , ** kwargs
1142+ ) as span :
11351143 self .span = span
11361144
11371145 self .span .start_timestamp = datetime (2024 , 1 , 1 , microsecond = 0 )
@@ -1144,7 +1152,7 @@ def __exit__(self, type, value, traceback):
11441152 pass
11451153
11461154 with mock .patch (
1147- "sentry_sdk.integrations.sqlalchemy.record_sql_queries " ,
1155+ "sentry_sdk.integrations.sqlalchemy.record_sql_queries_supporting_streaming " ,
11481156 fake_record_sql_queries ,
11491157 ):
11501158 assert session .query (Person ).first () == bob
0 commit comments