Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(legacy): remove legacy retention and insight cache code #27472

Merged
merged 10 commits into from
Jan 15, 2025
107 changes: 0 additions & 107 deletions ee/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
from posthog.queries.session_recordings.session_recording_list import (
SessionRecordingList,
)
from ee.clickhouse.queries.retention import ClickhouseRetention
from posthog.queries.util import get_earliest_timestamp
from posthog.models import Action, Cohort, Team, Organization
from posthog.models.filters.retention_filter import RetentionFilter
from posthog.models.filters.session_recordings_filter import SessionRecordingsFilter
from posthog.models.filters.stickiness_filter import StickinessFilter
from posthog.models.filters.filter import Filter
Expand Down Expand Up @@ -532,111 +530,6 @@ def track_session_recordings_list_person_property_filter(self):

SessionRecordingList(filter, self.team).run()

@benchmark_clickhouse
def track_retention(self):
filter = RetentionFilter(
data={
"insight": "RETENTION",
"target_event": {"id": "$pageview"},
"returning_event": {"id": "$pageview"},
"total_intervals": 14,
"retention_type": "retention_first_time",
"period": "Week",
**DATE_RANGE,
},
team=self.team,
)

ClickhouseRetention().run(filter, self.team)

@benchmark_clickhouse
def track_retention_with_person_breakdown(self):
filter = RetentionFilter(
data={
"insight": "RETENTION",
"target_event": {"id": "$pageview"},
"returning_event": {"id": "$pageview"},
"total_intervals": 14,
"retention_type": "retention_first_time",
"breakdown_type": "person",
"breakdowns": [
{"type": "person", "property": "$browser"},
{"type": "person", "property": "$browser_version"},
],
"period": "Week",
**DATE_RANGE,
},
team=self.team,
)

with no_materialized_columns():
ClickhouseRetention().run(filter, self.team)

@benchmark_clickhouse
def track_retention_filter_by_person_property(self):
filter = RetentionFilter(
data={
"insight": "RETENTION",
"target_event": {"id": "$pageview"},
"returning_event": {"id": "$pageview"},
"total_intervals": 14,
"retention_type": "retention_first_time",
"period": "Week",
"properties": [
{
"key": "email",
"operator": "icontains",
"value": ".com",
"type": "person",
}
],
**DATE_RANGE,
},
team=self.team,
)

with no_materialized_columns():
ClickhouseRetention().run(filter, self.team)

@benchmark_clickhouse
def track_retention_filter_by_person_property_materialized(self):
filter = RetentionFilter(
data={
"insight": "RETENTION",
"target_event": {"id": "$pageview"},
"returning_event": {"id": "$pageview"},
"total_intervals": 14,
"retention_type": "retention_first_time",
"period": "Week",
"properties": [
{
"key": "email",
"operator": "icontains",
"value": ".com",
"type": "person",
}
],
**DATE_RANGE,
},
team=self.team,
)

ClickhouseRetention().run(filter, self.team)

@benchmark_clickhouse
def track_lifecycle(self):
filter = Filter(
data={
"insight": "LIFECYCLE",
"events": [{"id": "$pageview", "type": "events"}],
"interval": "week",
"shown_as": "Lifecycle",
"date_from": "-14d",
**DATE_RANGE,
},
team=self.team,
)

Trends().run(filter, self.team)

@benchmark_clickhouse
Expand Down
12 changes: 0 additions & 12 deletions ee/clickhouse/queries/retention/retention.py

This file was deleted.

14 changes: 0 additions & 14 deletions ee/clickhouse/queries/retention/retention_actors.py

This file was deleted.

16 changes: 0 additions & 16 deletions ee/clickhouse/queries/retention/retention_event_query.py

This file was deleted.

Loading
Loading