Skip to content

remove unused import

1dcf176
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

ref: Add streaming trace decorator (7) #5594

remove unused import
1dcf176
Select commit
Loading
Failed to load commit list.
GitHub Actions / warden: find-bugs completed Mar 5, 2026 in 4m 36s

2 issues

find-bugs: Found 2 issues (1 medium, 1 low)

Medium

StreamedSpan.__exit__ is no-op, contradicting documented auto-finish behavior - `sentry_sdk/traces.py:237-240`

The __exit__ method added to StreamedSpan is a no-op (pass), but the documentation at line 88 states 'The span automatically finishes once the with block is exited' and the @trace decorator docstring (line 377) says it 'finishes the span when the function returns or raises an exception'. Additionally, unlike the existing Span.__exit__ in tracing.py (lines 396-406), this implementation doesn't set error status on exceptions, doesn't call a finish/end method, and doesn't restore scope state. Users relying on context manager semantics will have spans that never complete.

Low

Docstring references non-existent `op` parameter - `sentry_sdk/traces.py:381`

The docstring example mentions @trace(op="custom") but the trace function in sentry_sdk/traces.py does not accept an op parameter - it only accepts name, attributes, and active. This will confuse users who try to use the documented example. The op parameter exists in the other trace decorator in sentry_sdk/tracing.py but not in this streaming version.


Duration: 4m 33s · Tokens: 1.7M in / 11.2k out · Cost: $2.28 (+merge: $0.00)

Annotations

Check warning on line 240 in sentry_sdk/traces.py

See this annotation in the file changed.

@github-actions github-actions / warden: find-bugs

StreamedSpan.__exit__ is no-op, contradicting documented auto-finish behavior

The `__exit__` method added to `StreamedSpan` is a no-op (`pass`), but the documentation at line 88 states 'The span automatically finishes once the `with` block is exited' and the `@trace` decorator docstring (line 377) says it 'finishes the span when the function returns or raises an exception'. Additionally, unlike the existing `Span.__exit__` in tracing.py (lines 396-406), this implementation doesn't set error status on exceptions, doesn't call a finish/end method, and doesn't restore scope state. Users relying on context manager semantics will have spans that never complete.