From 72742cc5d98bd57b659a4eb98d709ab238f77028 Mon Sep 17 00:00:00 2001 From: Sanath Date: Tue, 13 Oct 2026 17:28:24 +0530 Subject: [PATCH 1/2] feat(types): export Attributes from the public types module --- sentry_sdk/types.py | 3 +++ tests/test_types.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/sentry_sdk/types.py b/sentry_sdk/types.py index a5bf01a83a..c0e2c3e385 100644 --- a/sentry_sdk/types.py +++ b/sentry_sdk/types.py @@ -13,6 +13,7 @@ if TYPE_CHECKING: # Re-export types to make them available in the public API from sentry_sdk._types import ( + Attributes, Breadcrumb, BreadcrumbHint, DataCollectionUserOptions, @@ -30,6 +31,7 @@ # The lines below allow the types to be imported from outside `if TYPE_CHECKING` # guards. The types in this module are only intended to be used for type hints. + Attributes = Any Breadcrumb = Any BreadcrumbHint = Any DataCollectionUserOptions = Any @@ -44,6 +46,7 @@ __all__ = ( + "Attributes", "Breadcrumb", "BreadcrumbHint", "DataCollectionUserOptions", diff --git a/tests/test_types.py b/tests/test_types.py index 0d25656551..0c4f5183bd 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -1,10 +1,17 @@ import sys +from typing import Optional import pytest from sentry_sdk.types import Event, Hint +def test_attributes_optional_runtime(): + from sentry_sdk.types import Attributes + + Optional[Attributes] + + @pytest.mark.skipif( sys.version_info < (3, 10), reason="Type hinting with `|` is available in Python 3.10+", From 378dc63f5fc745d72eaf7bf66274efc226ab183b Mon Sep 17 00:00:00 2001 From: Sanath Date: Tue, 13 Oct 2026 17:36:27 +0530 Subject: [PATCH 2/2] test: remove redundant Attributes annotation test --- tests/test_types.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/test_types.py b/tests/test_types.py index 0c4f5183bd..0d25656551 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -1,17 +1,10 @@ import sys -from typing import Optional import pytest from sentry_sdk.types import Event, Hint -def test_attributes_optional_runtime(): - from sentry_sdk.types import Attributes - - Optional[Attributes] - - @pytest.mark.skipif( sys.version_info < (3, 10), reason="Type hinting with `|` is available in Python 3.10+",