Api v1.15.0 (#1637)
* fix(chalice): fixed path-analysis's density support
This commit is contained in:
parent
deb8f551c1
commit
1d5e07080e
2 changed files with 5 additions and 4 deletions
|
|
@ -349,7 +349,8 @@ def path_analysis(project_id: int, data: schemas.CardPathAnalysis):
|
|||
sessions_count,
|
||||
avg_time_from_previous
|
||||
FROM n1)"""]
|
||||
for i in range(2, data.density):
|
||||
|
||||
for i in range(2, data.density + 1):
|
||||
steps_query.append(f"""n{i} AS (SELECT *
|
||||
FROM (SELECT re.event_number_in_session,
|
||||
re.event_type,
|
||||
|
|
@ -388,7 +389,7 @@ WITH sub_sessions AS (SELECT session_id {sub_sessions_extra_projection}
|
|||
row_number() OVER (PARTITION BY session_id ORDER BY timestamp {path_direction}) AS event_number_in_session
|
||||
FROM sub_events
|
||||
ORDER BY session_id) AS full_ranked_events
|
||||
WHERE event_number_in_session < %(density)s),
|
||||
WHERE event_number_in_session <= %(density)s),
|
||||
start_points AS (SELECT session_id
|
||||
FROM {start_points_from}
|
||||
WHERE {" AND ".join(start_points_conditions)}),
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ def path_analysis(project_id: int, data: schemas.CardPathAnalysis):
|
|||
sessions_count,
|
||||
avg_time_from_previous
|
||||
FROM n1"""]
|
||||
for i in range(2, data.density):
|
||||
for i in range(2, data.density + 1):
|
||||
steps_query.append(f"""n{i} AS (SELECT *
|
||||
FROM (SELECT re.event_number_in_session AS event_number_in_session,
|
||||
re.event_type AS event_type,
|
||||
|
|
@ -428,7 +428,7 @@ WITH {initial_event_cte}
|
|||
FROM {main_table}
|
||||
WHERE {" AND ".join(ch_sub_query)}
|
||||
) AS full_ranked_events
|
||||
WHERE event_number_in_session < 4)
|
||||
WHERE event_number_in_session <= %(density)s)
|
||||
SELECT *
|
||||
FROM pre_ranked_events;"""
|
||||
ch.execute(query=ch_query1, params=params)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue