From 0fec76df7b434d43e15f3ce054bd13b60b5cc9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Wed, 17 Jan 2024 17:39:12 +0100 Subject: [PATCH] fix retention query runner --- posthog/hogql_queries/insights/retention_query_runner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/posthog/hogql_queries/insights/retention_query_runner.py b/posthog/hogql_queries/insights/retention_query_runner.py index f9e4cfd71f31d1..b0ff7014603953 100644 --- a/posthog/hogql_queries/insights/retention_query_runner.py +++ b/posthog/hogql_queries/insights/retention_query_runner.py @@ -58,11 +58,11 @@ def get_applicable_entity(self, event_query_type): "type": TREND_FILTER_TYPE_EVENTS, } ) - target_entity = self.query.retentionFilter.target_entity or default_entity + target_entity = self.query.retentionFilter.targetEntity or default_entity if event_query_type in [RetentionQueryType.TARGET, RetentionQueryType.TARGET_FIRST_TIME]: return target_entity - return self.query.retentionFilter.returning_entity or target_entity + return self.query.retentionFilter.returningEntity or target_entity def retention_events_query(self, event_query_type) -> ast.SelectQuery: start_of_interval_sql = self.query_date_range.get_start_of_interval_hogql( @@ -186,7 +186,7 @@ def date_filter_expr(self, event_query_type) -> ast.Expr: def build_target_event_query(self) -> ast.SelectQuery: event_query_type = ( RetentionQueryType.TARGET_FIRST_TIME - if self.query.retentionFilter.retention_type == RetentionType.retention_first_time + if self.query.retentionFilter.retentionType == RetentionType.retention_first_time else RetentionQueryType.TARGET ) return self.retention_events_query(event_query_type=event_query_type) @@ -266,7 +266,7 @@ def to_query(self) -> ast.SelectQuery | ast.SelectUnionQuery: @cached_property def query_date_range(self) -> QueryDateRangeWithIntervals: - total_intervals = self.query.retentionFilter.total_intervals or DEFAULT_TOTAL_INTERVALS + total_intervals = self.query.retentionFilter.totalIntervals or DEFAULT_TOTAL_INTERVALS interval = ( IntervalType(self.query.retentionFilter.period.lower()) if self.query.retentionFilter.period