Skip to content

ref(data-collection): Rework DataCollection as a TypedDict, drop accessors#6702

Draft
ericapisani wants to merge 1 commit into
ep/db-spec-experiment-foundationfrom
ep/db-spec-experiement-foundation-dict
Draft

ref(data-collection): Rework DataCollection as a TypedDict, drop accessors#6702
ericapisani wants to merge 1 commit into
ep/db-spec-experiment-foundationfrom
ep/db-spec-experiement-foundation-dict

Conversation

@ericapisani

@ericapisani ericapisani commented Jun 30, 2026

Copy link
Copy Markdown
Member

Replace the class-based DataCollection/KeyValueCollectionBehavior/GenAICollection/HttpHeadersCollection API with plain TypedDicts

…ssors

Replace the class-based DataCollection/KeyValueCollectionBehavior/
GenAICollection/HttpHeadersCollection API with plain TypedDicts
(DataCollection, DataCollectionUserOptions, and per-category
*CollectionBehaviour/*UserOptions types) defined in _types.py.

Collection mode strings move from camelCase (denyList/allowList) to
snake_case (deny_list/allow_list) to match Python convention, since
this is a Python-only deviation from the spec that is never
serialized to Sentry.

Drop the should_collect_user_info/should_collect_gen_ai_inputs/
should_collect_gen_ai_outputs accessor methods and their module-level
shortcuts in favor of reading data_collection fields directly, and
drop the public sentry_sdk.DataCollection/GenAICollection/
HttpHeadersCollection/KeyValueCollectionBehavior exports.

Revert the Unreleased CHANGELOG entry and README example for the
prior class-based API.
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

90745 passed | ⏭️ 6240 skipped | Total: 96985 | Pass Rate: 93.57% | Execution Time: 324m 55s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +669
Passed Tests 📈 +727
Failed Tests
Skipped Tests 📉 -58

All tests are passing successfully.

✅ Patch coverage is 90.67%. Project has 2409 uncovered lines.
✅ Project coverage is 89.94%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
sentry_sdk/data_collection.py 91.55% ⚠️ 6 Missing and 7 partials
sentry_sdk/client.py 75.00% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.74%    89.94%     +0.2%
==========================================
  Files          192       193        +1
  Lines        23819     23952      +133
  Branches      8222      8304       +82
==========================================
+ Hits         21375     21543      +168
- Misses        2444      2409       -35
- Partials      1348      1352        +4

Generated by Codecov Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant