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

Random tweaks #3437

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion sentry_sdk/integrations/boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import sentry_sdk
from sentry_sdk.consts import OP, SPANDATA
from sentry_sdk.integrations import Integration, DidNotEnable
from sentry_sdk.tracing import Span

from sentry_sdk._types import TYPE_CHECKING
from sentry_sdk.utils import (
Expand All @@ -19,6 +18,8 @@
from typing import Optional
from typing import Type

from sentry_sdk.tracing import Span

try:
from botocore import __version__ as BOTOCORE_VERSION # type: ignore
from botocore.client import BaseClient # type: ignore
Expand Down
20 changes: 2 additions & 18 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,23 +697,6 @@ def clear(self):
# self._last_event_id is only applicable to isolation scopes
self._last_event_id = None # type: Optional[str]

@_attr_setter
def level(self, value):
# type: (LogLevelStr) -> None
"""
When set this overrides the level.

.. deprecated:: 1.0.0
Use :func:`set_level` instead.

:param value: The level to set.
"""
logger.warning(
"Deprecated: use .set_level() instead. This will be removed in the future."
)

self._level = value

def set_level(self, value):
# type: (LogLevelStr) -> None
"""
Expand Down Expand Up @@ -802,11 +785,12 @@ def set_user(self, value):
@property
def span(self):
# type: () -> Optional[Span]
"""Get/set current tracing span or transaction."""
"""Get current tracing span."""
return self._span

@span.setter
def span(self, span):
"""Set current tracing span."""
# type: (Optional[Span]) -> None
self._span = span
# XXX: this differs from the implementation in JS, there Scope.setSpan
Expand Down
5 changes: 1 addition & 4 deletions sentry_sdk/tracing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ def func_with_tracing(*args, **kwargs):


def get_current_span(scope=None):
# type: (Optional[sentry_sdk.Scope]) -> Optional[Span]
# type: (Optional[sentry_sdk.Scope]) -> Optional[sentry_sdk.tracing.Span]
"""
Returns the currently active span if there is one running, otherwise `None`
"""
Expand All @@ -702,6 +702,3 @@ def get_current_span(scope=None):
LOW_QUALITY_TRANSACTION_SOURCES,
SENTRY_TRACE_HEADER_NAME,
)

if TYPE_CHECKING:
from sentry_sdk.tracing import Span
Loading