From 2d6cd1dc174d310211cce597a28f7d45975226e2 Mon Sep 17 00:00:00 2001 From: Erica Pisani Date: Tue, 6 Oct 2026 11:33:54 -0400 Subject: [PATCH] ref: Remove should_send_default_pii helpers from client and scope Drop `BaseClient.should_send_default_pii`, `_Client.should_send_default_pii` and the module-level `scope.should_send_default_pii` shortcut. Fixes PY-2932 Fixes #7882 --- sentry_sdk/client.py | 11 ----------- sentry_sdk/scope.py | 5 ----- 2 files changed, 16 deletions(-) diff --git a/sentry_sdk/client.py b/sentry_sdk/client.py index 129002b610..c106373101 100644 --- a/sentry_sdk/client.py +++ b/sentry_sdk/client.py @@ -178,9 +178,6 @@ def dsn(self) -> "Optional[str]": def parsed_dsn(self) -> "Optional[Dsn]": return None - def should_send_default_pii(self) -> bool: - return False - def is_active(self) -> bool: """ .. versionadded:: 2.0.0 @@ -441,14 +438,6 @@ def is_active(self) -> bool: """ return True - def should_send_default_pii(self) -> bool: - """ - .. versionadded:: 2.0.0 - - Returns whether the client should send default PII (Personally Identifiable Information) data to Sentry. - """ - return self.options.get("send_default_pii") or False - @property def dsn(self) -> "Optional[str]": """Returns the configured DSN as string.""" diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index 75fdb8077d..6df27c470f 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -1870,11 +1870,6 @@ def use_isolation_scope(isolation_scope: "Scope") -> "Generator[Scope, None, Non capture_internal_exception(sys.exc_info()) -def should_send_default_pii() -> bool: - """Shortcut for `Scope.get_client().should_send_default_pii()`.""" - return Scope.get_client().should_send_default_pii() - - # Circular imports from sentry_sdk.client import NonRecordingClient