* 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
This commit is contained in:
Kraiem Taha Yassine 2025-01-17 18:15:26 +01:00 committed by GitHub
parent eb0fd35688
commit 74637f3042
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 17 deletions

View file

@ -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)}

View file

@ -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