Skip to content

chore: Remove include_local_variables, include_source_context - #7867

Merged
sentrivana merged 6 commits into
major/3.0from
ivana/major/drop-options-superseded-by-data-collection
Oct 6, 2026
Merged

sentrivana merged 6 commits into
major/3.0from
ivana/major/drop-options-superseded-by-data-collection

Conversation

@sentrivana

@sentrivana sentrivana commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

@linear-code

linear-code Bot commented Oct 5, 2026

Copy link
Copy Markdown

PY-2887

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 56514 passed | ⏭️ 2727 skipped | Total: 59241 | Pass Rate: 95.4% | Execution Time: 154m 55s

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2074 uncovered lines.
❌ Project coverage is 90%. Comparing base (c833d9b) to head (e46f50c).

Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.38%    90.00%    -0.38%
==========================================
  Files          202       185       -17
  Lines        26552     20731     -5821
  Branches      9858      7152     -2706
==========================================
+ Hits         23997     18657     -5340
- Misses        2555      2074      -481
- Partials      1487      1204      -283

Generated by Codecov Action

"""Check if abs_path is actually an absolute path. This can happen either
with eval/exec like here, or when the file in the frame is relative to
__main__"""
sentry_init()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've added these sentry_init() calls to multiple tests -- without them, data_collection would not be resolved and the config wouldn't be taken into account

Comment thread tests/test_utils.py
),
],
)
def test_include_source_context_when_serializing_frame(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is already extensively tested above

@sentrivana sentrivana changed the title chore: Remove include_local_variables, include_source_context chore: Remove include_local_variables, include_source_context Oct 6, 2026
@sentrivana
sentrivana marked this pull request as ready for review October 6, 2026 07:23
@sentrivana
sentrivana requested a review from a team as a code owner October 6, 2026 07:23

@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.

Stale Bugbot comment from a previous run.

Comment thread sentry_sdk/utils.py

@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.

Reviewed by Cursor Bugbot for commit e46f50c. Configure here.

Comment thread sentry_sdk/utils.py
dc_stack_frame_vars_config = client_options["data_collection"][
"stack_frame_variables"
]
dc_stack_frame_vars_config = data_collection["stack_frame_variables"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Frame serialization crashes without client

High Severity

serialize_frame now always reads data_collection from get_client(). When the SDK is not initialized, that client is a NonRecordingClient whose data_collection is None, so subscripting it raises TypeError. The old include_local_variables and include_source_context defaults no longer cover this path, so event_from_exception and exceptions_from_error_tuple can fail on any exception that has a traceback.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e46f50c. Configure here.

@sentrivana
sentrivana merged commit 71010cb into major/3.0 Oct 6, 2026
147 checks passed
@sentrivana
sentrivana deleted the ivana/major/drop-options-superseded-by-data-collection branch October 6, 2026 08:21
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