Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/sentry/utils/test_snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,18 @@ def test_preprocess_group_redirects(self) -> None:
assert params.conditions[0] == ["foo", "=", "bar"]
assert len(params.conditions) == 1

# Should not mutate inputs
filter_keys = {"group_id": {g4.id}}
conditions = [["group_id", "IN", [g1.id, g4.id]]]

SnubaQueryParams(
dataset=Dataset.Events,
filter_keys=filter_keys,
conditions=conditions,
)
assert filter_keys == {"group_id": {g4.id}}
assert conditions == [["group_id", "IN", [g1.id, g4.id]]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Test Fails to Verify Preprocessing Logic

The test doesn't enable the snuba.preprocess-group-redirects option before creating SnubaQueryParams, so _preprocess_group_id_redirects won't execute. This means the test doesn't actually verify that inputs aren't mutated during group redirect preprocessing, which is its intended purpose based on the comment and PR description.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Line 329

options.set("snuba.preprocess-group-redirects", True)

check yourself.



class QuantizeTimeTest(unittest.TestCase):
def setUp(self) -> None:
Expand Down
Loading