Skip to content

Commit

Permalink
fix: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed Dec 13, 2024
1 parent 3fc5060 commit 21672c9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions keep/api/core/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -4475,13 +4475,11 @@ def get_alerts_metrics_by_provider(
dynamic_field_sums = [
func.sum(
case(
[
(
func.json_extract(Alert.event, f"$.{field}").isnot(None)
& (func.json_extract(Alert.event, f"$.{field}") != False),
1,
)
],
(
func.json_extract(Alert.event, f"$.{field}").isnot(None)
& (func.json_extract(Alert.event, f"$.{field}") != False),
1,
),
else_=0,
)
).label(f"{field}_count")
Expand Down

0 comments on commit 21672c9

Please sign in to comment.