From 1b83e77fd345aa673a176c78666d85524f9eb379 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Fri, 16 Aug 2024 11:57:31 +0200 Subject: [PATCH] Dev (#2493) * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * fix(chalice): fixed Math-operators validation refactor(chalice): search for sessions that have events for heatmaps * refactor(chalice): search for sessions that have at least 1 location event for heatmaps * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * fix(chalice): fixed table of errors-per-domain with 0 results --- api/chalicelib/core/metrics.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/chalicelib/core/metrics.py b/api/chalicelib/core/metrics.py index b1caf7509..573594a8d 100644 --- a/api/chalicelib/core/metrics.py +++ b/api/chalicelib/core/metrics.py @@ -1731,7 +1731,7 @@ def get_errors_per_domains(project_id, limit, page, startTimestamp=TimeUTC.now(d **__get_constraint_values(args)} with pg_client.PostgresClient() as cur: - pg_query = f"""SELECT SUM(errors_count) AS count, + pg_query = f"""SELECT COALESCE(SUM(errors_count),0)::INT AS count, COUNT(raw.domain) AS total, jsonb_agg(raw) FILTER ( WHERE rn > %(limit_s)s AND rn <= %(limit_e)s ) AS values @@ -1750,6 +1750,7 @@ def get_errors_per_domains(project_id, limit, page, startTimestamp=TimeUTC.now(d cur.execute(pg_query) row = cur.fetchone() if row: + row["values"] = row["values"] or [] for r in row["values"]: r.pop("rn")