Skip to content

Commit

Permalink
feat: step towards feature folders for replay backend (#17484)
Browse files Browse the repository at this point in the history
* feat: step towards feature folders for replay backend

* Update query snapshots

* Update query snapshots

* that got mypy very excited

* fix

* fix

* fix

* dnagling snapshot

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
pauldambra and github-actions[bot] authored Sep 18, 2023
1 parent 8a7709d commit a87b247
Show file tree
Hide file tree
Showing 77 changed files with 456 additions and 400 deletions.
2 changes: 1 addition & 1 deletion ee/api/test/test_instance_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from posthog.client import sync_execute
from posthog.models.instance_setting import get_instance_setting
from posthog.models.performance.sql import PERFORMANCE_EVENT_DATA_TABLE
from posthog.models.session_recording_event.sql import SESSION_RECORDING_EVENTS_DATA_TABLE
from posthog.session_recordings.sql.session_recording_event_sql import SESSION_RECORDING_EVENTS_DATA_TABLE
from posthog.settings.data_stores import CLICKHOUSE_DATABASE
from posthog.test.base import ClickhouseTestMixin, snapshot_clickhouse_alter_queries

Expand Down
20 changes: 10 additions & 10 deletions ee/clickhouse/models/test/__snapshots__/test_cohort.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
(SELECT pdi.person_id AS person_id,
countIf(timestamp > now() - INTERVAL 2 year
AND timestamp < now()
AND event = '$pageview') > 0 AS performed_event_condition_17_level_level_0_level_0_level_0_0
AND event = '$pageview') > 0 AS performed_event_condition_15_level_level_0_level_0_level_0_0
FROM events e
INNER JOIN
(SELECT distinct_id,
Expand Down Expand Up @@ -113,7 +113,7 @@
HAVING max(is_deleted) = 0
AND (((((NOT has(['something1'], replaceRegexpAll(JSONExtractRaw(argMax(person.properties, version), '$some_prop'), '^"|"$', ''))))))))) person ON person.person_id = behavior_query.person_id
WHERE 1 = 1
AND ((((performed_event_condition_17_level_level_0_level_0_level_0_0)))) ) as person
AND ((((performed_event_condition_15_level_level_0_level_0_level_0_0)))) ) as person
UNION ALL
SELECT person_id,
cohort_id,
Expand Down Expand Up @@ -148,7 +148,7 @@
(SELECT pdi.person_id AS person_id,
countIf(timestamp > now() - INTERVAL 2 year
AND timestamp < now()
AND event = '$pageview') > 0 AS performed_event_condition_19_level_level_0_level_0_level_0_0
AND event = '$pageview') > 0 AS performed_event_condition_17_level_level_0_level_0_level_0_0
FROM events e
INNER JOIN
(SELECT distinct_id,
Expand Down Expand Up @@ -178,7 +178,7 @@
HAVING max(is_deleted) = 0
AND (((((NOT has(['something1'], replaceRegexpAll(JSONExtractRaw(argMax(person.properties, version), '$some_prop'), '^"|"$', ''))))))))) person ON person.person_id = behavior_query.person_id
WHERE 1 = 1
AND ((((performed_event_condition_19_level_level_0_level_0_level_0_0)))) ) ))
AND ((((performed_event_condition_17_level_level_0_level_0_level_0_0)))) ) ))
'
---
# name: TestCohort.test_cohortpeople_with_not_in_cohort_operator_for_behavioural_cohorts
Expand All @@ -195,7 +195,7 @@
FROM
(SELECT pdi.person_id AS person_id,
minIf(timestamp, event = 'signup') >= now() - INTERVAL 15 day
AND minIf(timestamp, event = 'signup') < now() as first_time_condition_20_level_level_0_level_0_0
AND minIf(timestamp, event = 'signup') < now() as first_time_condition_18_level_level_0_level_0_0
FROM events e
INNER JOIN
(SELECT distinct_id,
Expand All @@ -208,7 +208,7 @@
AND event IN ['signup']
GROUP BY person_id) behavior_query
WHERE 1 = 1
AND (((first_time_condition_20_level_level_0_level_0_0))) ) as person
AND (((first_time_condition_18_level_level_0_level_0_0))) ) as person
UNION ALL
SELECT person_id,
cohort_id,
Expand Down Expand Up @@ -237,9 +237,9 @@
(SELECT pdi.person_id AS person_id,
countIf(timestamp > now() - INTERVAL 2 year
AND timestamp < now()
AND event = '$pageview') > 0 AS performed_event_condition_21_level_level_0_level_0_level_0_0,
AND event = '$pageview') > 0 AS performed_event_condition_19_level_level_0_level_0_level_0_0,
minIf(timestamp, event = 'signup') >= now() - INTERVAL 15 day
AND minIf(timestamp, event = 'signup') < now() as first_time_condition_21_level_level_0_level_1_level_0_level_0_level_0_0
AND minIf(timestamp, event = 'signup') < now() as first_time_condition_19_level_level_0_level_1_level_0_level_0_level_0_0
FROM events e
INNER JOIN
(SELECT distinct_id,
Expand All @@ -252,8 +252,8 @@
AND event IN ['$pageview', 'signup']
GROUP BY person_id) behavior_query
WHERE 1 = 1
AND ((((performed_event_condition_21_level_level_0_level_0_level_0_0))
AND ((((NOT first_time_condition_21_level_level_0_level_1_level_0_level_0_level_0_0)))))) ) as person
AND ((((performed_event_condition_19_level_level_0_level_0_level_0_0))
AND ((((NOT first_time_condition_19_level_level_0_level_1_level_0_level_0_level_0_0)))))) ) as person
UNION ALL
SELECT person_id,
cohort_id,
Expand Down
2 changes: 1 addition & 1 deletion ee/clickhouse/models/test/__snapshots__/test_property.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
))
',
<class 'dict'> {
'global_cohort_id_0': 1,
'global_cohort_id_0': 47,
'global_version_0': None,
},
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# name: ClickhouseTestExperimentSecondaryResults.test_basic_secondary_metric_results
'
/* user_id:138 celery:posthog.celery.sync_insight_caching_state */
/* user_id:128 celery:posthog.celery.sync_insight_caching_state */
SELECT team_id,
date_diff('second', max(timestamp), now()) AS age
FROM events
Expand Down
Loading

0 comments on commit a87b247

Please sign in to comment.