diff --git a/keep/api/core/db.py b/keep/api/core/db.py index 67f3d7ca9..53cea2213 100644 --- a/keep/api/core/db.py +++ b/keep/api/core/db.py @@ -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")