From 74637f30426e9e8a124f9dce041e7fb8b5181634 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Fri, 17 Jan 2025 18:15:26 +0100 Subject: [PATCH] Dev (#2954) * feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * feat(chalice): hardcoded user journey for testing (+ support of drop&other events) * refactor(chalice): upgraded dependencies --- .../core/metrics/product_analytics.py | 33 ++++++++++--------- ee/api/requirements.txt | 4 +-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/api/chalicelib/core/metrics/product_analytics.py b/api/chalicelib/core/metrics/product_analytics.py index ff9c83904..934cd33ad 100644 --- a/api/chalicelib/core/metrics/product_analytics.py +++ b/api/chalicelib/core/metrics/product_analytics.py @@ -11,6 +11,9 @@ logger = logging.getLogger(__name__) def __transform_journey(rows, reverse_path=False): + print("---------------------------------") + print(rows) + print("---------------------------------") total_100p = 0 number_of_step1 = 0 for r in rows: @@ -30,23 +33,23 @@ def __transform_journey(rows, reverse_path=False): if source not in nodes: nodes.append(source) nodes_values.append({"name": r['e_value'], "eventType": r['event_type']}) - if r['next_value']: - target = f"{r['event_number_in_session'] + 1}_{r['next_type']}_{r['next_value']}" - if target not in nodes: - nodes.append(target) - nodes_values.append({"name": r['next_value'], "eventType": r['next_type']}) + # if r['next_value']: + target = f"{r['event_number_in_session'] + 1}_{r['next_type']}_{r['next_value']}" + if target not in nodes: + nodes.append(target) + nodes_values.append({"name": r['next_value'], "eventType": r['next_type']}) - sr_idx = nodes.index(source) - tg_idx = nodes.index(target) + sr_idx = nodes.index(source) + tg_idx = nodes.index(target) - link = {"eventType": r['event_type'], "sessionsCount": r["sessions_count"],"value": r["value"]} - if not reverse_path: - link["source"] = sr_idx - link["target"] = tg_idx - else: - link["source"] = tg_idx - link["target"] = sr_idx - links.append(link) + link = {"eventType": r['event_type'], "sessionsCount": r["sessions_count"],"value": r["value"]} + if not reverse_path: + link["source"] = sr_idx + link["target"] = tg_idx + else: + link["source"] = tg_idx + link["target"] = sr_idx + links.append(link) return {"nodes": nodes_values, "links": sorted(links, key=lambda x: (x["source"], x["target"]), reverse=False)} diff --git a/ee/api/requirements.txt b/ee/api/requirements.txt index 7b849d9fe..453644421 100644 --- a/ee/api/requirements.txt +++ b/ee/api/requirements.txt @@ -1,5 +1,5 @@ # Keep this version to not have conflicts between requests and boto3 -urllib3==1.26.16 +urllib3==2.3.0 requests==2.32.3 boto3==1.35.60 pyjwt==2.9.0 @@ -23,7 +23,7 @@ clickhouse-driver[lz4]==0.2.9 #--no-binary is used to avoid libxml2 library version incompatibilities between xmlsec and lxml lxml >= 4.6.5, !=4.7.0, <=5.2.1 python3-saml==1.16.0 --no-binary=lxml -python-multipart==0.0.17 +python-multipart==0.0.20 redis==5.2.0 #confluent-kafka==2.1.0