Skip to content

Commit 89c9594

Browse files
rename database_transaction_spans to db_transaction_spans
1 parent 3ccd0c3 commit 89c9594

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

sentry_sdk/integrations/django/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(
132132
middleware_spans=True, # type: bool
133133
signals_spans=True, # type: bool
134134
cache_spans=False, # type: bool
135-
database_transaction_spans=False, # type: bool
135+
db_transaction_spans=False, # type: bool
136136
signals_denylist=None, # type: Optional[list[signals.Signal]]
137137
http_methods_to_capture=DEFAULT_HTTP_METHODS_TO_CAPTURE, # type: tuple[str, ...]
138138
):
@@ -149,7 +149,7 @@ def __init__(
149149
self.signals_denylist = signals_denylist or []
150150

151151
self.cache_spans = cache_spans
152-
self.database_transaction_spans = database_transaction_spans
152+
self.db_transaction_spans = db_transaction_spans
153153

154154
self.http_methods_to_capture = tuple(map(str.upper, http_methods_to_capture))
155155

@@ -697,7 +697,7 @@ def _commit(self):
697697
# type: (BaseDatabaseWrapper) -> None
698698
integration = sentry_sdk.get_client().get_integration(DjangoIntegration)
699699

700-
if integration is None or not integration.database_transaction_spans:
700+
if integration is None or not integration.db_transaction_spans:
701701
return real_commit(self)
702702

703703
with sentry_sdk.start_span(

tests/integrations/django/test_db_transactions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_db_transaction_spans_disabled_atomic(sentry_init, client, capture_event
177177
@pytest_mark_django_db_decorator(transaction=True)
178178
def test_db_no_autocommit_execute(sentry_init, client, capture_events):
179179
sentry_init(
180-
integrations=[DjangoIntegration(database_transaction_spans=True)],
180+
integrations=[DjangoIntegration(db_transaction_spans=True)],
181181
traces_sample_rate=1.0,
182182
)
183183

@@ -235,7 +235,7 @@ def test_db_no_autocommit_execute(sentry_init, client, capture_events):
235235
@pytest_mark_django_db_decorator(transaction=True)
236236
def test_db_no_autocommit_executemany(sentry_init, client, capture_events):
237237
sentry_init(
238-
integrations=[DjangoIntegration(database_transaction_spans=True)],
238+
integrations=[DjangoIntegration(db_transaction_spans=True)],
239239
traces_sample_rate=1.0,
240240
)
241241

@@ -319,7 +319,7 @@ def test_db_no_autocommit_executemany(sentry_init, client, capture_events):
319319
@pytest_mark_django_db_decorator(transaction=True)
320320
def test_db_atomic_execute(sentry_init, client, capture_events):
321321
sentry_init(
322-
integrations=[DjangoIntegration(database_transaction_spans=True)],
322+
integrations=[DjangoIntegration(db_transaction_spans=True)],
323323
traces_sample_rate=1.0,
324324
)
325325

@@ -377,7 +377,7 @@ def test_db_atomic_execute(sentry_init, client, capture_events):
377377
@pytest_mark_django_db_decorator(transaction=True)
378378
def test_db_atomic_executemany(sentry_init, client, capture_events):
379379
sentry_init(
380-
integrations=[DjangoIntegration(database_transaction_spans=True)],
380+
integrations=[DjangoIntegration(db_transaction_spans=True)],
381381
send_default_pii=True,
382382
traces_sample_rate=1.0,
383383
)

0 commit comments

Comments
 (0)