Skip to content

Commit

Permalink
Refactored to not change the default value of send_default_pii
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Nov 21, 2024
1 parent 7911570 commit 15cf625
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ def _get_options(*args, **kwargs):
rv["traces_sample_rate"] = 1.0

if rv["event_scrubber"] is None:
rv["event_scrubber"] = EventScrubber(
send_default_pii=(
False if rv["send_default_pii"] is None else rv["send_default_pii"]
)
)
rv["event_scrubber"] = EventScrubber(send_default_pii=rv["send_default_pii"])

if rv["socket_options"] and not isinstance(rv["socket_options"], list):
logger.warning(
Expand Down Expand Up @@ -455,9 +451,10 @@ def should_send_default_pii(self):
Returns whether the client should send default PII (Personally Identifiable Information) data to Sentry.
"""
result = self.options.get("send_default_pii")
if result is None:
result = not self.options["dsn"] and self.spotlight is not None
result = self.options.get("send_default_pii", False)

if not self.options["dsn"] and self.spotlight is not None:
result = True

return result

Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def __init__(
transport=None, # type: Optional[Union[sentry_sdk.transport.Transport, Type[sentry_sdk.transport.Transport], Callable[[Event], None]]]
transport_queue_size=DEFAULT_QUEUE_SIZE, # type: int
sample_rate=1.0, # type: float
send_default_pii=None, # type: Optional[bool]
send_default_pii=False, # type: bool
http_proxy=None, # type: Optional[str]
https_proxy=None, # type: Optional[str]
ignore_errors=[], # type: Sequence[Union[type, str]] # noqa: B006
Expand Down

0 comments on commit 15cf625

Please sign in to comment.