Skip to content

Commit b5b96b8

Browse files
authored
ref(graphene): Drop support for send_default_pii (#7697)
Closes https://linear.app/getsentry/issue/PY-2823/remove-send-default-pii-from-graphene
1 parent 3d307be commit b5b96b8

2 files changed

Lines changed: 98 additions & 200 deletions

File tree

‎sentry_sdk/integrations/graphene.py‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import sentry_sdk
44
from sentry_sdk.consts import OP
55
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
6-
from sentry_sdk.scope import should_send_default_pii
76
from sentry_sdk.utils import (
87
capture_internal_exceptions,
98
ensure_integration_enabled,
109
event_from_exception,
11-
has_data_collection_enabled,
1210
parse_version,
1311
)
1412

@@ -112,13 +110,7 @@ async def _sentry_patched_graphql_async(
112110
def _event_processor(event: "Event", hint: "Dict[str, Any]") -> "Event":
113111
client_options = sentry_sdk.get_client().options
114112

115-
if has_data_collection_enabled(client_options):
116-
if client_options["data_collection"]["graphql"]["document"]:
117-
request_info = event.setdefault("request", {})
118-
request_info["api_target"] = "graphql"
119-
elif event.get("request", {}).get("data"):
120-
del event["request"]["data"]
121-
elif should_send_default_pii():
113+
if client_options["data_collection"]["graphql"]["document"]:
122114
request_info = event.setdefault("request", {})
123115
request_info["api_target"] = "graphql"
124116
elif event.get("request", {}).get("data"):
@@ -159,10 +151,7 @@ def graphql_span(
159151
return
160152

161153
additional_attributes = {}
162-
if has_data_collection_enabled(client_options):
163-
if client_options["data_collection"]["graphql"]["document"]:
164-
additional_attributes["graphql.document"] = source
165-
elif should_send_default_pii():
154+
if client_options["data_collection"]["graphql"]["document"]:
166155
additional_attributes["graphql.document"] = source
167156

168157
_graphql_span = sentry_sdk.start_span(

0 commit comments

Comments
 (0)