Repository navigation
ref(data-collection)!: Drop send_default_pii mapping and provided_by_user - #7883
Conversation
…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
Codecov Results 📊✅ 55379 passed | ⏭️ 2727 skipped | Total: 58106 | Pass Rate: 95.31% | Execution Time: 154m 23s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 76.47%. Project has 2060 uncovered lines. Files with missing lines (2)
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 -272Generated 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.
| ) | ||
| if options is None: | ||
| options = dict(DEFAULT_OPTIONS) | ||
| options["data_collection"] = _resolve_data_collection(options) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
with the changes in this branch, this became a duplicate of another within the test file
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
) 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

Remove
_map_from_send_default_piiand theprovided_by_userflag from the resolvedDataCollection.data_collectionis now always resolved from its explicit options (with spec defaults), so thesend_default_piifallback branches are no longer needed.has_data_collection_enabledand readdata_collectiondirectly inget_lines_from_file,Scope, outgoing request URL attributes, and the FastAPI and Strawberry integrations.data_collection.Fixes PY-2932
Fixes #7882