Skip to content
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

Guard against sentry initialization mid sqlalchemy cursor #2702

Merged
merged 1 commit into from Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/sqlalchemy.py
Expand Up @@ -95,7 +95,7 @@
context._sentry_sql_span_manager = None
ctx_mgr.__exit__(None, None, None)

span = context._sentry_sql_span
span = getattr(context, "_sentry_sql_span", None) # type: Optional[Span]

Check warning on line 98 in sentry_sdk/integrations/sqlalchemy.py

View check run for this annotation

Codecov / codecov/patch

sentry_sdk/integrations/sqlalchemy.py#L98

Added line #L98 was not covered by tests
if span is not None:
with capture_internal_exceptions():
add_query_source(hub, span)
Expand Down