Skip to content

Commit 1ac2faf

Browse files
ref: Remove helpers left over from EventScrubber removal (#8158)
### Description Removes two helpers that only `EventScrubber` used: - `iter_event_frames()` in `sentry_sdk/utils.py` - `AnnotatedValue.substituted_because_contains_sensitive_data()` in `sentry_sdk/_types.py` #7772 ("Remove `EventScrubber` and the `event_scrubber` option") deleted `sentry_sdk/scrubber.py`, which held the only call to each of them: frame-vars scrubbing called `iter_event_frames(event)`, and denylisted keys were replaced with `AnnotatedValue.substituted_because_contains_sensitive_data()`. Both helpers were left behind. **Evidence** - On `major/3.0`, `git grep -w` for each name matches only its definition. There are no callers in `sentry_sdk`, `tests`, `scripts` or `docs`. - No open PR touches either one. `iter_event_stacktraces()` (used by `handle_in_app`) and `SENSITIVE_DATA_SUBSTITUTE` (used by the data-collection filtering and several integrations) are still used, so they stay. On `master`, `EventScrubber` still uses both helpers, so this only applies to `major/3.0`. `iter_event_frames` could be imported from `sentry_sdk.utils`, but it isn't documented anywhere, and `major/3.0` is already a breaking release. #### Issues n/a <!-- junior-request-attribution:start --> via **Ivana Kellyer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
1 parent f58c75b commit 1ac2faf

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

‎sentry_sdk/_types.py‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,6 @@ def substituted_because_over_size_limit(
112112
},
113113
)
114114

115-
@classmethod
116-
def substituted_because_contains_sensitive_data(cls) -> "AnnotatedValue":
117-
"""The actual value was removed because it contained sensitive information."""
118-
return AnnotatedValue(
119-
value=SENSITIVE_DATA_SUBSTITUTE,
120-
metadata={
121-
"rem": [ # Remark
122-
[
123-
"!config", # Because of SDK configuration (in this case the config is the hard coded removal of certain django cookies)
124-
"s", # The fields original value was substituted
125-
]
126-
]
127-
},
128-
)
129-
130115

131116
T = TypeVar("T")
132117
Annotated = Union[AnnotatedValue, T]

‎sentry_sdk/utils.py‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -986,15 +986,6 @@ def iter_event_stacktraces(event: "Event") -> "Iterator[Annotated[Dict[str, Any]
986986
yield exception["stacktrace"]
987987

988988

989-
def iter_event_frames(event: "Event") -> "Iterator[Dict[str, Any]]":
990-
for stacktrace in iter_event_stacktraces(event):
991-
if isinstance(stacktrace, AnnotatedValue):
992-
stacktrace = stacktrace.value or {}
993-
994-
for frame in stacktrace.get("frames") or ():
995-
yield frame
996-
997-
998989
def handle_in_app(
999990
event: "Event",
1000991
in_app_exclude: "Optional[List[str]]" = None,

0 commit comments

Comments
 (0)