Skip to content

Duplicate group snql bug #7035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
26 changes: 26 additions & 0 deletions tests/test_snql_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,32 @@ def test_avg_gauges(self) -> None:

assert response.status_code == 200, data

def test_buggy_query(self) -> None:
response = self.post(
"/discover/snql",
data=json.dumps(
{
"consistent": False,
"query": "MATCH { MATCH (events) SELECT group_id, argMax(event_id, timestamp) AS `event_id`, argMax(title, timestamp) AS `title`, argMax(exception_frames.filename, timestamp) AS `exception_frames.filename`, argMax(exception_frames.function, timestamp) AS `exception_frames.function` BY group_id WHERE project_id IN array(1) AND group_id IN array(6359260219, 6087680054, 6390261498, 6365203340, 6400032892, 6031005315, 6360744188, 6372010905, 6469432548, 6469437311) AND timestamp >= toDateTime('2025-03-21T15:50:40.875807') AND timestamp < toDateTime('2025-04-04T15:50:40.875813') } SELECT group_id, event_id, title WHERE arrayElement(exception_frames.function, -20) LIKE '%::user' LIMIT 5",
"dataset": "events",
"app_id": "default",
"tenant_ids": {"organization_id": [1], "referrer": "seer.rpc"},
"parent_api": "/api/0/internal/seer-rpc/{method_name}/",
}
),
)
data = json.loads(response.data)

assert response.status_code == 200, data
assert data["stats"]["consistent"]
assert data["data"] == [
{
"count": 1,
"tags[custom_tag]": "custom_value",
"project_id": self.project_id,
}
]

def test_simple_query(self) -> None:
response = self.post(
"/discover/snql",
Expand Down
Loading