Skip to content

ref(data-collection)!: Drop send_default_pii mapping and provided_by_user - #7883

Merged
ericapisani merged 11 commits into
major/3.0from
py-2932-remove-map-send-default-pii
Oct 6, 2026
Merged

ericapisani merged 11 commits into
major/3.0from
py-2932-remove-map-send-default-pii

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Remove _map_from_send_default_pii and the provided_by_user flag from the resolved DataCollection. data_collection is now always resolved from its explicit options (with spec defaults), so the send_default_pii fallback branches are no longer needed.

  • Delete has_data_collection_enabled and read data_collection directly in get_lines_from_file, Scope, outgoing request URL attributes, and the FastAPI and Strawberry integrations.
  • Drop the DSN-less Spotlight re-derivation of data_collection.

Fixes PY-2932
Fixes #7882

…by_user`

Remove `_map_from_send_default_pii` and the `provided_by_user` flag from
the resolved `DataCollection`. `data_collection` is now always resolved
from its explicit options (with spec defaults), so the `send_default_pii`
fallback branches are no longer needed.

- Delete `has_data_collection_enabled` and read `data_collection`
  directly in `get_lines_from_file`, `Scope`, outgoing request URL
  attributes, and the FastAPI and Strawberry integrations.
- Drop the DSN-less Spotlight re-derivation of `data_collection`.

Fixes PY-2932
Fixes #7882
@linear-code

linear-code Bot commented Oct 6, 2026

Copy link
Copy Markdown

PY-2932

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 55379 passed | ⏭️ 2727 skipped | Total: 58106 | Pass Rate: 95.31% | Execution Time: 154m 23s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -75625
Passed Tests 📉 -71221
Failed Tests —
Skipped Tests 📉 -4404

All tests are passing successfully.

❌ Patch coverage is 76.47%. Project has 2060 uncovered lines.
❌ Project coverage is 90.03%. Comparing base (a3135ed) to head (59aa0c4).

Files with missing lines (2)
File Patch % Lines
sentry_sdk/tracing_utils.py 0.00% ⚠️ 3 Missing
sentry_sdk/data_collection.py 75.00% ⚠️ 1 Missing and 1 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.37%    90.03%    -0.34%
==========================================
  Files          202       185       -17
  Lines        26552     20672     -5880
  Branches      9858      7116     -2742
==========================================
+ Hits         23997     18612     -5385
- Misses        2555      2060      -495
- Partials      1487      1215      -272

Generated by Codecov Action

Update the `data_collection` docstring and move the redis, logs, metrics,
scope and tracing-utils tests off `send_default_pii`. Drop tests that
asserted the removed `send_default_pii` behaviour.
Comment thread sentry_sdk/client.py
)
if options is None:
options = dict(DEFAULT_OPTIONS)
options["data_collection"] = _resolve_data_collection(options)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to do this extra step because we need to resolve the empty dictionary into default values.



@pytest.mark.asyncio
async def test_execute_many_record_params_with_data_collection_enabled(

@ericapisani ericapisani Oct 6, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the changes in this branch, this became a duplicate of another within the test file

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests removed here were all introduced to ensure that data collection was resolving correctly at a time when we didn't yet have integrations ported over. These are now redundant since the integrations are now testing the behaviour end-to-end.

@ericapisani
ericapisani marked this pull request as ready for review October 6, 2026 14:53
@ericapisani
ericapisani requested a review from a team as a code owner October 6, 2026 14:53

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 704c9c2. Configure here.

Comment thread sentry_sdk/data_collection.py
)

Drop `BaseClient.should_send_default_pii`,
`_Client.should_send_default_pii` and the module-level
`scope.should_send_default_pii` shortcut.

Fixes PY-2932
Fixes #7882
@ericapisani
ericapisani merged commit 4ea3a83 into major/3.0 Oct 6, 2026
5 checks passed
@ericapisani
ericapisani deleted the py-2932-remove-map-send-default-pii branch October 6, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants