Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions sentry_sdk/integrations/arq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
from sentry_sdk.consts import OP, SPANDATA
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.integrations.logging import ignore_logger_for_events
from sentry_sdk.scope import should_send_default_pii
from sentry_sdk.traces import SegmentNameSource
from sentry_sdk.utils import (
SENSITIVE_DATA_SUBSTITUTE,
_register_control_flow_exception,
capture_internal_exceptions,
ensure_integration_enabled,
event_from_exception,
has_data_collection_enabled,
parse_version,
reraise,
)
Expand Down Expand Up @@ -152,16 +149,9 @@ def event_processor(event: "Event", hint: "Hint") -> "Optional[Event]":
}
client_options = sentry_sdk.get_client().options

if has_data_collection_enabled(client_options):
if client_options["data_collection"]["queues"]:
arq_job_dict["args"] = args
arq_job_dict["kwargs"] = kwargs
elif should_send_default_pii():
if client_options["data_collection"]["queues"]:
arq_job_dict["args"] = args
arq_job_dict["kwargs"] = kwargs
else:
arq_job_dict["args"] = SENSITIVE_DATA_SUBSTITUTE
arq_job_dict["kwargs"] = SENSITIVE_DATA_SUBSTITUTE

extra["arq-job"] = arq_job_dict

Expand Down
6 changes: 3 additions & 3 deletions tests/integrations/arq/test_arq.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def inner(
sentry_init_kwargs = {
"integrations": [ArqIntegration()],
"traces_sample_rate": 1.0,
"send_default_pii": True,
"data_collection": {},
}
sentry_init_kwargs.update(init_kwargs or {})
sentry_init(**sentry_init_kwargs)
Expand Down Expand Up @@ -111,7 +111,7 @@ def inner(
sentry_init_kwargs = {
"integrations": [ArqIntegration()],
"traces_sample_rate": 1.0,
"send_default_pii": True,
"data_collection": {},
}
sentry_init_kwargs.update(init_kwargs or {})
sentry_init(**sentry_init_kwargs)
Expand Down Expand Up @@ -162,7 +162,7 @@ def inner(
sentry_init_kwargs = {
"integrations": [ArqIntegration()],
"traces_sample_rate": 1.0,
"send_default_pii": True,
"data_collection": {},
}
sentry_init_kwargs.update(init_kwargs or {})
sentry_init(**sentry_init_kwargs)
Expand Down
26 changes: 0 additions & 26 deletions tests/integrations/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import pytest

from sentry_sdk.utils import SENSITIVE_DATA_SUBSTITUTE

# Shared parametrization test matrix exercising the precedence between the legacy
# ``send_default_pii`` boolean and the ``data_collection.user_info`` setting.
# Each case is ``(init_kwargs, expect_user_info)`` where the second element indicates
Expand Down Expand Up @@ -93,28 +91,4 @@
None,
id="data_collection_queues_off",
),
pytest.param(
{"send_default_pii": False},
SENSITIVE_DATA_SUBSTITUTE,
SENSITIVE_DATA_SUBSTITUTE,
id="no_pii",
),
pytest.param(
{
"data_collection": {"queues": False},
"send_default_pii": False,
},
None,
None,
id="data_collection_queues_off_with_no_pii",
),
pytest.param(
{
"data_collection": {"queues": True},
"send_default_pii": False,
},
[1],
{"b": 0},
id="data_collection_queues_on_with_no_pii",
),
]
Loading