Skip to content

ref: Allow to start and finish StreamedSpans (9)#5598

Merged
sentrivana merged 58 commits into
masterfrom
ivana/span-first-9-start-end
Mar 10, 2026
Merged

ref: Allow to start and finish StreamedSpans (9)#5598
sentrivana merged 58 commits into
masterfrom
ivana/span-first-9-start-end

add a guard

dab1970
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
GitHub Actions / warden: code-review completed Mar 9, 2026 in 2m 38s

1 issue

code-review: Found 1 issue (1 high)

High

hasattr() call is missing required second argument, causing TypeError at runtime - `sentry_sdk/traces.py:454-455`

The hasattr(self._previous_span_on_scope) call on line 454 is missing the required second argument. Python's hasattr() requires two arguments: the object and the attribute name as a string. This will raise TypeError: hasattr expected 2 arguments, got 1 whenever _end() is called on a NoOpStreamedSpan with a valid _scope. The fix should be hasattr(self, "_previous_span_on_scope").


Duration: 2m 37s · Tokens: 584.9k in / 7.5k out · Cost: $0.79 (+fix_gate: $0.00)

Annotations

Check failure on line 455 in sentry_sdk/traces.py

See this annotation in the file changed.

@github-actions github-actions / warden: code-review

hasattr() call is missing required second argument, causing TypeError at runtime

The `hasattr(self._previous_span_on_scope)` call on line 454 is missing the required second argument. Python's `hasattr()` requires two arguments: the object and the attribute name as a string. This will raise `TypeError: hasattr expected 2 arguments, got 1` whenever `_end()` is called on a `NoOpStreamedSpan` with a valid `_scope`. The fix should be `hasattr(self, "_previous_span_on_scope")`.