From 7bab39d891bd94d290d6ca7bdce66cacfbcd6d13 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Wed, 3 Jul 2024 18:11:10 +0200 Subject: [PATCH] Dev (#2349) * refactor(chalice): upgraded dependencies * refactor(chalice): upgraded dependencies feat(chalice): support heatmaps * feat(chalice): support table-of-browsers showing user-count * feat(chalice): support table-of-devices showing user-count * feat(chalice): support table-of-URLs showing user-count * 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): check timestamp is not null before selecting EXP_MV --- ee/api/chalicelib/utils/exp_ch_helper.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ee/api/chalicelib/utils/exp_ch_helper.py b/ee/api/chalicelib/utils/exp_ch_helper.py index 2ac05e23c..2ffac6d54 100644 --- a/ee/api/chalicelib/utils/exp_ch_helper.py +++ b/ee/api/chalicelib/utils/exp_ch_helper.py @@ -2,17 +2,17 @@ from chalicelib.utils.TimeUTC import TimeUTC from decouple import config import logging -logging.basicConfig(level=config("LOGLEVEL", default=logging.INFO)) +logger = logging.getLogger(__name__) if config("EXP_7D_MV", cast=bool, default=True): - print(">>> Using experimental last 7 days materialized views") + logger.info(">>> Using experimental last 7 days materialized views") def get_main_events_table(timestamp=0, platform="web"): if platform == "web": return "experimental.events_l7d_mv" \ if config("EXP_7D_MV", cast=bool, default=True) \ - and timestamp >= TimeUTC.now(delta_days=-7) else "experimental.events" + and timestamp and timestamp >= TimeUTC.now(delta_days=-7) else "experimental.events" else: return "experimental.ios_events" @@ -20,13 +20,13 @@ def get_main_events_table(timestamp=0, platform="web"): def get_main_sessions_table(timestamp=0): return "experimental.sessions_l7d_mv" \ if config("EXP_7D_MV", cast=bool, default=True) \ - and timestamp >= TimeUTC.now(delta_days=-7) else "experimental.sessions" + and timestamp and timestamp >= TimeUTC.now(delta_days=-7) else "experimental.sessions" def get_main_resources_table(timestamp=0): return "experimental.resources_l7d_mv" \ if config("EXP_7D_MV", cast=bool, default=True) \ - and timestamp >= TimeUTC.now(delta_days=-7) else "experimental.resources" + and timestamp and timestamp >= TimeUTC.now(delta_days=-7) else "experimental.resources" def get_autocomplete_table(timestamp=0):