Skip to content

Commit d7cdb32

Browse files
ref(huey): Drop send_default_pii support (#7728)
### Description Remove `send_default_pii` support from Huey integration. #### Issues Resolves #7594
1 parent 609ccad commit d7cdb32

2 files changed

Lines changed: 9 additions & 19 deletions

File tree

‎sentry_sdk/integrations/huey.py‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from sentry_sdk.api import get_baggage, get_traceparent
77
from sentry_sdk.consts import OP, SPANDATA
88
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
9-
from sentry_sdk.scope import should_send_default_pii
109
from sentry_sdk.traces import (
1110
BAGGAGE_HEADER_NAME,
1211
SENTRY_TRACE_HEADER_NAME,
@@ -15,12 +14,10 @@
1514
SpanStatus,
1615
)
1716
from sentry_sdk.utils import (
18-
SENSITIVE_DATA_SUBSTITUTE,
1917
_register_control_flow_exception,
2018
capture_internal_exceptions,
2119
ensure_integration_enabled,
2220
event_from_exception,
23-
has_data_collection_enabled,
2421
parse_version,
2522
reraise,
2623
)
@@ -132,16 +129,9 @@ def event_processor(event: "Event", hint: "Hint") -> "Optional[Event]":
132129
}
133130

134131
client_options = sentry_sdk.get_client().options
135-
if has_data_collection_enabled(client_options):
136-
if client_options["data_collection"]["queues"]:
137-
huey_job["args"] = task.args
138-
huey_job["kwargs"] = task.kwargs
139-
elif should_send_default_pii():
132+
if client_options["data_collection"]["queues"]:
140133
huey_job["args"] = task.args
141134
huey_job["kwargs"] = task.kwargs
142-
else:
143-
huey_job["args"] = SENSITIVE_DATA_SUBSTITUTE
144-
huey_job["kwargs"] = SENSITIVE_DATA_SUBSTITUTE
145135

146136
extra["huey-job"] = huey_job
147137

‎tests/integrations/huey/test_huey.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from sentry_sdk.integrations.huey import HueyIntegration
1111
from sentry_sdk.traces import SegmentNameSource, SpanStatus
1212
from sentry_sdk.utils import parse_version
13-
from tests.integrations.utils import DATA_COLLECTION_QUEUES_CASES_LEGACY
13+
from tests.integrations.utils import DATA_COLLECTION_QUEUES_CASES
1414

1515
HUEY_VERSION = parse_version(HUEY_VERSION)
1616

@@ -23,13 +23,13 @@
2323

2424
@pytest.fixture
2525
def init_huey(sentry_init):
26-
def inner(init_kwargs=None):
26+
def inner(data_collection=None):
2727
sentry_init_kwargs = {
2828
"integrations": [HueyIntegration()],
2929
"traces_sample_rate": 1.0,
30-
"send_default_pii": True,
3130
}
32-
sentry_init_kwargs.update(init_kwargs or {})
31+
if data_collection is not None:
32+
sentry_init_kwargs["data_collection"] = data_collection
3333
sentry_init(**sentry_init_kwargs)
3434

3535
return MemoryHuey(name="sentry_sdk")
@@ -204,17 +204,17 @@ def maybe_locked_task():
204204

205205

206206
@pytest.mark.parametrize(
207-
"init_kwargs,expected_args,expected_kwargs",
208-
DATA_COLLECTION_QUEUES_CASES_LEGACY,
207+
"data_collection,expected_args,expected_kwargs",
208+
DATA_COLLECTION_QUEUES_CASES,
209209
)
210210
def test_task_args_kwargs_data_collection(
211211
capture_items,
212212
init_huey,
213-
init_kwargs,
213+
data_collection,
214214
expected_args,
215215
expected_kwargs,
216216
):
217-
huey = init_huey(init_kwargs=init_kwargs)
217+
huey = init_huey(data_collection=data_collection)
218218

219219
@huey.task()
220220
def division(a, b):

0 commit comments

Comments
 (0)