Skip to content

Commit ce50949

Browse files
committed
Fix types
1 parent cb1aab1 commit ce50949

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
except ImportError:
4545
raise DidNotEnable("Anthropic not installed")
4646

47+
from sentry_sdk.tracing import Span
48+
4749
if TYPE_CHECKING:
4850
from typing import Any, AsyncIterator, Iterator, List, Optional, Union
49-
from sentry_sdk.tracing import Span
5051
from sentry_sdk._types import TextPart
5152

5253

@@ -551,7 +552,7 @@ def _sentry_patched_create_sync(*args: "Any", **kwargs: "Any") -> "Any":
551552
return _execute_sync(f, *args, **kwargs)
552553
finally:
553554
span = sentry_sdk.get_current_span()
554-
if span is not None and span.status == SPANSTATUS.INTERNAL_ERROR:
555+
if isinstance(span, Span) and span.status == SPANSTATUS.INTERNAL_ERROR:
555556
with capture_internal_exceptions():
556557
span.__exit__(None, None, None)
557558

@@ -589,7 +590,7 @@ async def _sentry_patched_create_async(*args: "Any", **kwargs: "Any") -> "Any":
589590
return await _execute_async(f, *args, **kwargs)
590591
finally:
591592
span = sentry_sdk.get_current_span()
592-
if span is not None and span.status == SPANSTATUS.INTERNAL_ERROR:
593+
if isinstance(span, Span) and span.status == SPANSTATUS.INTERNAL_ERROR:
593594
with capture_internal_exceptions():
594595
span.__exit__(None, None, None)
595596

sentry_sdk/integrations/celery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def _inner(*args: "Any", **kwargs: "Any") -> "Any":
449449

450450
with capture_internal_exceptions():
451451
with task.app.connection() as conn:
452-
span.set_data(
452+
set_on_span(
453453
SPANDATA.MESSAGING_SYSTEM,
454454
conn.transport.driver_type,
455455
)

sentry_sdk/integrations/threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def setup_once() -> None:
5858
django_version = None
5959

6060
try:
61-
import channels # type: ignore[import-untyped]
61+
import channels # type: ignore[import-not-found]
6262

6363
channels_version = channels.__version__
6464
except (ImportError, AttributeError):

sentry_sdk/scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ def set_transaction_name(self, name: str, source: "Optional[str]" = None) -> Non
826826
self._transaction = name
827827
if self._span:
828828
if isinstance(self._span, StreamedSpan):
829-
self._span.segment.name = name
829+
self._span.segment.set_name(name)
830830
if source:
831831
self._span.segment.set_source(source)
832832

sentry_sdk/traces.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ def __init__(
288288
else:
289289
self._sample_rand = _generate_sample_rand(self.trace_id)
290290

291-
self._flags: dict[str, bool] = {}
292291
self._continuous_profile: "Optional[ContinuousProfile]" = None
293292

294293
self._update_active_thread()

0 commit comments

Comments
 (0)