Skip to content

Commit

Permalink
Fixed deprecated transaction creation
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Dec 5, 2023
1 parent 34d91ac commit 0420460
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,7 @@ def start_span(self, span=None, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`.
"""
hub = kwargs.pop("hub", None)
client = kwargs.pop("client", None)
client = kwargs.get("client", None)

configuration_instrumenter = client and client.options["instrumenter"]

Expand All @@ -739,7 +738,7 @@ def start_span(self, span=None, instrumenter=INSTRUMENTER.SENTRY, **kwargs):

if isinstance(span, Transaction):
logger.warning(deprecation_msg)
return self.start_transaction(span)
return self.start_transaction(span, **kwargs)

Check warning on line 741 in sentry_sdk/scope.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/scope.py#L740-L741

Added lines #L740 - L741 were not covered by tests

if "transaction" in kwargs:
logger.warning(deprecation_msg)
Expand All @@ -753,7 +752,7 @@ def start_span(self, span=None, instrumenter=INSTRUMENTER.SENTRY, **kwargs):
logger.warning(deprecation_msg)
return span

Check warning on line 753 in sentry_sdk/scope.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/scope.py#L751-L753

Added lines #L751 - L753 were not covered by tests

kwargs.setdefault("hub", hub)
kwargs.pop("client")

active_span = self.span
if active_span is not None:
Expand Down

0 comments on commit 0420460

Please sign in to comment.