Skip to content

ref: Simplify Scope.root_span logic #4274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: szokeasaurusrex/root_span-type
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,16 +691,9 @@ def fingerprint(self, value):
def root_span(self):
# type: () -> Optional[Span]
"""Return the root span in the scope, if any."""

# there is no span/transaction on the scope
if self._span is None:
return None

# there is an orphan span on the scope
if self._span.root_span is None:
return None
# there is either a root span (which is its own root
# span) or a non-orphan span on the scope
return self._span.root_span

def set_transaction_name(self, name, source=None):
Expand Down