Skip to content

Commit 87cee2f

Browse files
authored
fix(snuba): don't mutate filter_keys (#103177)
Some callsites are re-using the same dictionary. It causes problems when we `del filter_keys["group_id"]` (because that mutates the input dict). This PR runs a copy before mutating, so the original input should not be mutated.
1 parent 14e9f3b commit 87cee2f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/sentry/utils/snuba.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ def _preprocess_group_id_redirects(self):
940940
in_groups = None
941941
out_groups: set[int | str] = set()
942942
if "group_id" in self.filter_keys:
943+
self.filter_keys = self.filter_keys.copy()
943944
in_groups = get_all_merged_group_ids(self.filter_keys["group_id"])
944945
del self.filter_keys["group_id"]
945946

0 commit comments

Comments
 (0)