Skip to content

Commit 23846df

Browse files
more renaming
1 parent b00b725 commit 23846df

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

sentry_sdk/integrations/asyncpg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from sentry_sdk.tracing_utils import (
1313
add_query_source,
1414
has_span_streaming_enabled,
15-
record_sql_queries_supporting_streaming,
15+
record_sql_queries,
1616
)
1717
from sentry_sdk.utils import (
1818
capture_internal_exceptions,
@@ -80,7 +80,7 @@ async def _inner(*args: "Any", **kwargs: "Any") -> "T":
8080
return await f(*args, **kwargs)
8181

8282
query = _normalize_query(args[1])
83-
with record_sql_queries_supporting_streaming(
83+
with record_sql_queries(
8484
cursor=None,
8585
query=query,
8686
params_list=None,
@@ -121,7 +121,7 @@ def _record(
121121
param_style = "pyformat" if params_list else None
122122

123123
query = _normalize_query(query)
124-
with record_sql_queries_supporting_streaming(
124+
with record_sql_queries(
125125
cursor=cursor,
126126
query=query,
127127
params_list=params_list,

tests/integrations/asyncpg/test_asyncpg.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from sentry_sdk import capture_message, start_transaction
2424
from sentry_sdk.consts import SPANDATA
2525
from sentry_sdk.integrations.asyncpg import AsyncPGIntegration
26-
from sentry_sdk.tracing_utils import record_sql_queries_supporting_streaming
26+
from sentry_sdk.tracing_utils import record_sql_queries
2727
from tests.conftest import ApproxDict
2828

2929
PG_HOST = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_HOST", "localhost")
@@ -799,7 +799,7 @@ async def test_no_query_source_if_duration_too_short(
799799

800800
@contextmanager
801801
def fake_record_sql_queries_streaming(*args, **kwargs):
802-
with record_sql_queries_supporting_streaming(*args, **kwargs) as span:
802+
with record_sql_queries(*args, **kwargs) as span:
803803
pass
804804
span._start_timestamp = datetime.datetime(2024, 1, 1, microsecond=0)
805805
if span_streaming:
@@ -812,7 +812,7 @@ def fake_record_sql_queries_streaming(*args, **kwargs):
812812
conn: Connection = await connect(PG_CONNECTION_URI)
813813

814814
with mock.patch(
815-
"sentry_sdk.integrations.asyncpg.record_sql_queries_supporting_streaming",
815+
"sentry_sdk.integrations.asyncpg.record_sql_queries",
816816
fake_record_sql_queries_streaming,
817817
):
818818
await conn.execute(
@@ -842,14 +842,14 @@ def fake_record_sql_queries_streaming(*args, **kwargs):
842842

843843
@contextmanager
844844
def fake_record_sql_queries(*args, **kwargs):
845-
with record_sql_queries_supporting_streaming(*args, **kwargs) as span:
845+
with record_sql_queries(*args, **kwargs) as span:
846846
pass
847847
span.start_timestamp = datetime.datetime(2024, 1, 1, microsecond=0)
848848
span.timestamp = datetime.datetime(2024, 1, 1, microsecond=99999)
849849
yield span
850850

851851
with mock.patch(
852-
"sentry_sdk.integrations.asyncpg.record_sql_queries_supporting_streaming",
852+
"sentry_sdk.integrations.asyncpg.record_sql_queries",
853853
fake_record_sql_queries,
854854
):
855855
await conn.execute(
@@ -886,14 +886,14 @@ async def test_query_source_if_duration_over_threshold(sentry_init, capture_even
886886

887887
@contextmanager
888888
def fake_record_sql_queries(*args, **kwargs):
889-
with record_sql_queries_supporting_streaming(*args, **kwargs) as span:
889+
with record_sql_queries(*args, **kwargs) as span:
890890
pass
891891
span.start_timestamp = datetime.datetime(2024, 1, 1, microsecond=0)
892892
span.timestamp = datetime.datetime(2024, 1, 1, microsecond=100001)
893893
yield span
894894

895895
with mock.patch(
896-
"sentry_sdk.integrations.asyncpg.record_sql_queries_supporting_streaming",
896+
"sentry_sdk.integrations.asyncpg.record_sql_queries",
897897
fake_record_sql_queries,
898898
):
899899
await conn.execute(

0 commit comments

Comments
 (0)