Skip to content

remove print

98c67f0
Select commit
Loading
Failed to load commit list.
Merged

feat(sqlalchemy): Support span streaming #6132

remove print
98c67f0
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Apr 24, 2026 in 7m 41s

2 issues

find-bugs: Found 2 issues (2 low)

Low

Type annotation in _handle_error does not match actual span type - `sentry_sdk/integrations/sqlalchemy.py:107-113`

The type annotation span: "Optional[Span]" on line 107 declares the span as the legacy Span type only, but the code immediately checks isinstance(span, StreamedSpan) on line 110, indicating the span can also be a StreamedSpan. This inconsistency could mislead type checkers and developers about the actual types flowing through this function. While not a runtime bug (Python doesn't enforce type annotations), it could cause static analysis tools to report false negatives or positives.

Inconsistent handling of None query in streaming vs non-streaming paths - `sentry_sdk/tracing_utils.py:212-224`

In record_sql_queries_supporting_streaming, when span streaming is enabled (line 212), a None query is replaced with "<unknown SQL query>" for the span name. However, in the non-streaming path (line 224), query is passed directly to sentry_sdk.start_span without this fallback, maintaining the same behavior as the original record_sql_queries. Additionally, the breadcrumb on line 208 uses query directly as the message without the fallback, creating an inconsistency where the streaming span name would differ from the breadcrumb message when query is None.


Duration: 7m 35s · Tokens: 5.3M in / 47.1k out · Cost: $8.15 (+extraction: $0.01, +merge: $0.00, +fix_gate: $0.00)