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

Switch all deprecation warnings to the warnings Python module. #4110

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions sentry_sdk/integrations/threading.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
from functools import wraps
from threading import Thread, current_thread
import warnings

import sentry_sdk
from sentry_sdk.integrations import Integration
Expand Down
14 changes: 9 additions & 5 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,10 @@ def trace_propagation_meta(self, *args, **kwargs):
"""
span = kwargs.pop("span", None)
if span is not None:
logger.warning(
"The parameter `span` in trace_propagation_meta() is deprecated and will be removed in the future."
warnings.warn(
"The parameter `span` in trace_propagation_meta() is deprecated and will be removed in the future.",
stacklevel=2,
category=DeprecationWarning,
)

meta = ""
Expand Down Expand Up @@ -734,10 +736,12 @@ def transaction(self, value):
# Without breaking version compatibility, we could make the setter set a
# transaction name or transaction (self._span) depending on the type of
# the value argument.

logger.warning(
"Assigning to scope.transaction directly is deprecated: use scope.set_transaction_name() instead."
warnings.warn(
"Assigning to scope.transaction directly is deprecated: use scope.set_transaction_name() instead.",
stacklevel=2,
category=DeprecationWarning,
)

self._transaction = value
if self._span and self._span.containing_transaction:
self._span.containing_transaction.name = value
Expand Down
Loading