Skip to content

Commit 609ccad

Browse files
ref(dramatiq): Drop send_default_pii support (#7706)
### Description - `request_body_within_bounds()` still has some `send_default_pii` branching, but this will be fixed in #7616. #### Issues Resolves #7726
1 parent 68fa9c2 commit 609ccad

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

‎sentry_sdk/integrations/dramatiq.py‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
AnnotatedValue,
1616
capture_internal_exceptions,
1717
event_from_exception,
18-
has_data_collection_enabled,
1918
parse_version,
2019
)
2120

@@ -226,13 +225,7 @@ def extract_into_event(self, event: "Event") -> None:
226225
request_info = contexts.setdefault("dramatiq", {})
227226
request_info["type"] = "dramatiq"
228227

229-
attach_request_body = True
230-
if has_data_collection_enabled(client.options):
231-
attach_request_body = (
232-
"incoming_request" in client.options["data_collection"]["http_bodies"]
233-
)
234-
235-
if attach_request_body:
228+
if client.options["data_collection"]["queues"]:
236229
data: "Optional[Union[AnnotatedValue, Dict[str, Any]]]" = None
237230
if not request_body_within_bounds(client, self.content_length()):
238231
data = AnnotatedValue.removed_because_over_size_limit()

‎tests/integrations/dramatiq/test_dramatiq.py‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ def dummy_actor(x, y):
355355
True,
356356
],
357357
)
358+
@pytest.mark.parametrize("broker", [{"data_collection": {}}], indirect=True)
358359
def test_that_message_data_is_added_as_request(
359360
broker, worker, capture_events, fail_fast
360361
):
@@ -394,16 +395,21 @@ def dummy_actor(x, y):
394395
@pytest.mark.parametrize(
395396
"broker,expect_message_data",
396397
[
397-
pytest.param({}, True, id="data_collection_not_enabled"),
398+
pytest.param({"data_collection": {}}, True, id="data_collection_default"),
398399
pytest.param(
399-
{"data_collection": {"http_bodies": ["incoming_request"]}},
400+
{"data_collection": {"queues": True}},
400401
True,
401-
id="data_collection_http_bodies_incoming_request",
402+
id="data_collection_queues_on",
402403
),
403404
pytest.param(
404-
{"data_collection": {"http_bodies": []}},
405+
{"data_collection": {"queues": False}},
405406
False,
406-
id="data_collection_http_bodies_empty",
407+
id="data_collection_queues_off",
408+
),
409+
pytest.param(
410+
{"data_collection": {"queues": True, "http_bodies": []}},
411+
True,
412+
id="data_collection_queues_independent_of_http_bodies",
407413
),
408414
],
409415
indirect=["broker"],
@@ -433,7 +439,7 @@ def dummy_actor(x, y):
433439

434440
@pytest.mark.parametrize(
435441
"broker",
436-
[{"data_collection": {"http_bodies": []}}],
442+
[{"data_collection": {"queues": False}}],
437443
indirect=True,
438444
)
439445
def test_that_dramatiq_context_type_is_set_regardless_of_data_collection(

0 commit comments

Comments
 (0)