mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 04:12:23 +01:00
3f53c815c7
* add initial scaffolding * _get_distinct_id_query --> _get_person_ids_query * retention query changes * full retention support for v2 * Update query snapshots * add comments * Update query snapshots * debug local vs remote * fix tests * another try at debugging * fix? * Update query snapshots * Update query snapshots * fix --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
17 lines
698 B
Python
17 lines
698 B
Python
from posthog.models.group.util import get_aggregation_target_field
|
|
from posthog.queries.retention.retention_events_query import RetentionEventsQuery
|
|
|
|
|
|
class ClickhouseRetentionEventsQuery(RetentionEventsQuery):
|
|
def target_field(self) -> str:
|
|
if self._aggregate_users_by_distinct_id and not self._filter.aggregation_group_type_index:
|
|
return f"{self.EVENT_TABLE_ALIAS}.distinct_id AS target"
|
|
else:
|
|
return "{} as target".format(
|
|
get_aggregation_target_field(
|
|
self._filter.aggregation_group_type_index,
|
|
self.EVENT_TABLE_ALIAS,
|
|
self._person_id_alias,
|
|
)
|
|
)
|