Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sentry_sdk/ai/monitoring.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import inspect
import sys
import warnings
from functools import wraps
from typing import TYPE_CHECKING

Expand Down Expand Up @@ -29,6 +30,13 @@


def ai_track(description: str, **span_kwargs: "Any") -> "Callable[[F], F]":
warnings.warn(
"sentry_sdk.ai.ai_track is deprecated and will be removed in version 3.0 of sentry-sdk. "
"Use the manual span API instead, e.g. sentry_sdk.start_span().",
DeprecationWarning,
stacklevel=2,
)

Check warning on line 38 in sentry_sdk/ai/monitoring.py

View check run for this annotation

@sentry/warden / warden: find-bugs

`ai_track` deprecation warning breaks test suite

The new `warnings.warn` inside `ai_track` emits a `DeprecationWarning` on every test using the decorator, but no tests were updated to expect it. The global warning checker in `tests/__init__.py`/`conftest.py` treats any un-whitelisted sentry_sdk warning as a hard `AssertionError`.
Comment thread
alexander-alderman-webb marked this conversation as resolved.

def decorator(f: "F") -> "F":
def sync_wrapped(*args: "Any", **kwargs: "Any") -> "Any":
client = sentry_sdk.get_client()
Expand Down
Loading