Skip to content

Commit eb1d6a7

Browse files
merge master
2 parents 5817f96 + c84b6d8 commit eb1d6a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1254
-625
lines changed

.github/workflows/warden.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ ignore = [
227227
"N804", # First argument of classmethod should be named cls
228228

229229
# Additional ignores for codebase compatibility
230-
"F401", # Unused imports - many in TYPE_CHECKING blocks used for type comments
231230
"E721", # Use isinstance instead of type() == - existing pattern in this codebase
232231
]
233232

scripts/populate_tox/populate_tox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from packaging.specifiers import SpecifierSet
2121
from packaging.version import Version
2222
from pathlib import Path
23-
from textwrap import dedent
2423
from typing import Optional, Union
2524

2625
# Adding the scripts directory to PATH. This is necessary in order to be able

sentry_sdk/_batcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from datetime import datetime, timezone
55
from typing import TYPE_CHECKING, TypeVar, Generic
66

7-
from sentry_sdk.utils import format_timestamp, safe_repr, serialize_attribute
7+
from sentry_sdk.utils import format_timestamp
88
from sentry_sdk.envelope import Envelope, Item, PayloadRef
99

1010
if TYPE_CHECKING:

sentry_sdk/_log_batcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from sentry_sdk._batcher import Batcher
44
from sentry_sdk.utils import serialize_attribute
5-
from sentry_sdk.envelope import Envelope, Item, PayloadRef
5+
from sentry_sdk.envelope import Item, PayloadRef
66

77
if TYPE_CHECKING:
88
from typing import Any

sentry_sdk/_metrics_batcher.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from sentry_sdk._batcher import Batcher
44
from sentry_sdk.utils import serialize_attribute
5-
from sentry_sdk.envelope import Item
65

76
if TYPE_CHECKING:
87
from typing import Any

sentry_sdk/_span_batcher.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
from typing import TYPE_CHECKING
55

66
from sentry_sdk._batcher import Batcher
7-
from sentry_sdk.consts import SPANSTATUS
87
from sentry_sdk.envelope import Envelope, Item, PayloadRef
9-
from sentry_sdk.utils import format_timestamp, serialize_attribute, safe_repr
8+
from sentry_sdk.utils import format_timestamp, serialize_attribute
109

1110
if TYPE_CHECKING:
1211
from typing import Any, Callable, Optional
1312
from sentry_sdk.traces import StreamedSpan
14-
from sentry_sdk._types import SerializedAttributeValue
1513

1614

1715
class SpanBatcher(Batcher["StreamedSpan"]):

sentry_sdk/_types.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
try:
2+
from re import Pattern
3+
except ImportError:
4+
# 3.6
5+
from typing import Pattern
6+
17
from typing import TYPE_CHECKING, TypeVar, Union
28

39

@@ -103,7 +109,6 @@ def substituted_because_contains_sensitive_data(cls) -> "AnnotatedValue":
103109
from typing import Mapping
104110
from typing import NotRequired
105111
from typing import Optional
106-
from typing import Tuple
107112
from typing import Type
108113
from typing_extensions import Literal, TypedDict
109114

@@ -361,3 +366,11 @@ class SDKInfo(TypedDict):
361366
class TextPart(TypedDict):
362367
type: Literal["text"]
363368
content: str
369+
370+
IgnoreSpansName = Union[str, Pattern[str]]
371+
IgnoreSpansContext = TypedDict(
372+
"IgnoreSpansContext",
373+
{"name": IgnoreSpansName, "attributes": Attributes},
374+
total=False,
375+
)
376+
IgnoreSpansConfig = list[Union[IgnoreSpansName, IgnoreSpansContext]]

sentry_sdk/ai/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from .utils import (
2-
set_data_normalized,
3-
GEN_AI_MESSAGE_ROLE_MAPPING,
4-
GEN_AI_MESSAGE_ROLE_REVERSE_MAPPING,
5-
normalize_message_role,
6-
normalize_message_roles,
7-
set_conversation_id,
8-
) # noqa: F401
2+
set_data_normalized, # noqa: F401
3+
GEN_AI_MESSAGE_ROLE_MAPPING, # noqa: F401
4+
GEN_AI_MESSAGE_ROLE_REVERSE_MAPPING, # noqa: F401
5+
normalize_message_role, # noqa: F401
6+
normalize_message_roles, # noqa: F401
7+
set_conversation_id, # noqa: F401
8+
)

sentry_sdk/ai/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import inspect
22
import json
3-
from collections import deque
43
from copy import deepcopy
5-
from sys import getsizeof
64
from typing import TYPE_CHECKING
75

86
from sentry_sdk._types import BLOB_DATA_SUBSTITUTE

0 commit comments

Comments
 (0)