From 021db6b79d397a3162a031cac548d5ad54d14764 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Fri, 12 Sep 2025 10:10:20 +0200 Subject: [PATCH] Correctly check for a running transaction --- sentry_sdk/ai/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_sdk/ai/utils.py b/sentry_sdk/ai/utils.py index 41f89f5623..d0ccf1bed3 100644 --- a/sentry_sdk/ai/utils.py +++ b/sentry_sdk/ai/utils.py @@ -44,6 +44,6 @@ def get_start_span_function(): # type: () -> Callable[..., Any] current_span = sentry_sdk.get_current_span() transaction_exists = ( - current_span is not None and current_span.containing_transaction == current_span + current_span is not None and current_span.containing_transaction is not None ) return sentry_sdk.start_span if transaction_exists else sentry_sdk.start_transaction