From 05c057cfb58ad74eecf92640d1fefe17d3813483 Mon Sep 17 00:00:00 2001 From: Vladimir Filonov Date: Wed, 13 Nov 2024 23:02:10 +0400 Subject: [PATCH] Return group by to incidents_subquery --- keep/api/core/db.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keep/api/core/db.py b/keep/api/core/db.py index f4f94a649..849254cdd 100644 --- a/keep/api/core/db.py +++ b/keep/api/core/db.py @@ -1291,6 +1291,7 @@ def get_last_alerts( ).label("incidents"), ) .filter(LastAlertToIncident.deleted_at == NULL_FOR_DELETED_AT) + .group_by(LastAlertToIncident.fingerprint) .subquery() ) @@ -1304,6 +1305,7 @@ def get_last_alerts( ).label("incidents"), ) .filter(LastAlertToIncident.deleted_at == NULL_FOR_DELETED_AT) + .group_by(LastAlertToIncident.fingerprint) .subquery() ) @@ -1318,6 +1320,7 @@ def get_last_alerts( ).label("incidents"), ) .filter(LastAlertToIncident.deleted_at == NULL_FOR_DELETED_AT) + .group_by(LastAlertToIncident.fingerprint) .subquery() ) else: