From e47f95dda7d115d76225c0a5c206a6a01594652f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Wed, 17 Jan 2024 23:08:59 +0100 Subject: [PATCH] fixes --- .../test/test_retention_query_runner.py | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/posthog/hogql_queries/insights/test/test_retention_query_runner.py b/posthog/hogql_queries/insights/test/test_retention_query_runner.py index 93ade3ac992b83..bdb11516624542 100644 --- a/posthog/hogql_queries/insights/test/test_retention_query_runner.py +++ b/posthog/hogql_queries/insights/test/test_retention_query_runner.py @@ -223,7 +223,7 @@ def test_month_interval(self): "dateRange": {"date_to": _date(0, month=5, hour=0)}, "retentionFilter": { "period": "Month", - "total_intervals": 11, + "totalIntervals": 11, }, } ) @@ -397,7 +397,7 @@ def test_month_interval_with_person_on_events_v2(self): "dateRange": {"date_to": _date(0, month=5, hour=0)}, "retentionFilter": { "period": "Month", - "total_intervals": 11, + "totalIntervals": 11, }, } ) @@ -490,7 +490,7 @@ def test_week_interval(self): "dateRange": {"date_to": _date(10, month=1, hour=0)}, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, } result_sunday = self.run_query(query=query) @@ -598,7 +598,7 @@ def test_hour_interval(self): "dateRange": {"date_to": _date(0, hour=16, minute=13)}, "retentionFilter": { "period": "Hour", - "total_intervals": 11, + "totalIntervals": 11, }, } ) @@ -690,7 +690,7 @@ def test_interval_rounding(self): "dateRange": {"date_to": _date(14, month=1, hour=0)}, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, } ) @@ -780,9 +780,9 @@ def test_retention_people_first_time(self): query={ "dateRange": {"date_to": _date(10, hour=6)}, "retentionFilter": { - "target_entity": {"id": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS}, - "returning_entity": {"id": "$pageview", "type": "events"}, - "retention_type": RETENTION_FIRST_TIME, + "targetEntity": {"id": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS}, + "returningEntity": {"id": "$pageview", "type": "events"}, + "retentionType": RETENTION_FIRST_TIME, }, }, ) @@ -795,9 +795,9 @@ def test_retention_people_first_time(self): query={ "dateRange": {"date_to": _date(14, hour=6)}, "retentionFilter": { - "target_entity": {"id": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS}, - "returning_entity": {"id": "$pageview", "type": "events"}, - "retention_type": RETENTION_FIRST_TIME, + "targetEntity": {"id": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS}, + "returningEntity": {"id": "$pageview", "type": "events"}, + "retentionType": RETENTION_FIRST_TIME, }, }, ) @@ -882,9 +882,9 @@ def test_retention_people_in_period_first_time(self): query={ "dateRange": {"date_to": _date(10, hour=6)}, "retentionFilter": { - "target_entity": {"id": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS}, - "returning_entity": {"id": "$pageview", "type": "events"}, - "retention_type": RETENTION_FIRST_TIME, + "targetEntity": {"id": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS}, + "returningEntity": {"id": "$pageview", "type": "events"}, + "retentionType": RETENTION_FIRST_TIME, }, }, ) @@ -926,9 +926,9 @@ def test_retention_multiple_events(self): "dateRange": {"date_to": _date(6, hour=6)}, "retentionFilter": { "period": "Day", - "total_intervals": 7, - "target_entity": {"id": first_event, "name": first_event, "type": TREND_FILTER_TYPE_EVENTS}, - "returning_entity": {"id": "$pageview", "name": "$pageview", "type": "events"}, + "totalIntervals": 7, + "targetEntity": {"id": first_event, "name": first_event, "type": TREND_FILTER_TYPE_EVENTS}, + "returningEntity": {"id": "$pageview", "name": "$pageview", "type": "events"}, }, } ) @@ -984,9 +984,9 @@ def test_retention_any_event(self): "dateRange": {"date_to": _date(6, hour=6)}, "retentionFilter": { "period": "Day", - "total_intervals": 7, - "target_entity": {"id": None, "type": "events"}, - "returning_entity": {"id": None, "type": "events"}, + "totalIntervals": 7, + "targetEntity": {"id": None, "type": "events"}, + "returningEntity": {"id": None, "type": "events"}, }, } ) @@ -1035,13 +1035,13 @@ def test_retention_event_action(self): query={ "dateRange": {"date_to": _date(6, hour=0)}, "retentionFilter": { - "total_intervals": 7, - "target_entity": { + "totalIntervals": 7, + "targetEntity": { "id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS, }, - "returning_entity": { + "returningEntity": { "id": some_event, "name": some_event, "type": TREND_FILTER_TYPE_EVENTS, @@ -1078,14 +1078,14 @@ def test_first_time_retention(self): "dateRange": {"date_to": _date(5, hour=6)}, "retentionFilter": { "period": "Day", - "total_intervals": 7, - "retention_type": RETENTION_FIRST_TIME, - "target_entity": { + "totalIntervals": 7, + "retentionType": RETENTION_FIRST_TIME, + "targetEntity": { "id": "$user_signed_up", "name": "$user_signed_up", "type": TREND_FILTER_TYPE_EVENTS, }, - "returning_entity": {"id": "$pageview", "name": "$pageview", "type": "events"}, + "returningEntity": {"id": "$pageview", "name": "$pageview", "type": "events"}, }, } ) @@ -1233,7 +1233,7 @@ def test_retention_with_user_properties(self): ], }, "retentionFilter": { - "total_intervals": 7, + "totalIntervals": 7, }, } ) @@ -1297,9 +1297,9 @@ def test_retention_with_user_properties_via_action(self): query={ "dateRange": {"date_to": _date(6, hour=0)}, "retentionFilter": { - "total_intervals": 7, - "target_entity": {"id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS}, - "returning_entity": {"id": "$pageview", "name": "$pageview", "type": "events"}, + "totalIntervals": 7, + "targetEntity": {"id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS}, + "returningEntity": {"id": "$pageview", "name": "$pageview", "type": "events"}, }, } ) @@ -1348,9 +1348,9 @@ def test_retention_action_start_point(self): "dateRange": {"date_to": _date(6, hour=0)}, "retentionFilter": { "period": "Day", - "total_intervals": 7, - "target_entity": {"id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS}, - "returning_entity": {"id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS}, + "totalIntervals": 7, + "targetEntity": {"id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS}, + "returningEntity": {"id": action.pk, "name": action.name, "type": TREND_FILTER_TYPE_ACTIONS}, }, } ) @@ -1741,7 +1741,7 @@ def test_groups_aggregating(self): "aggregation_group_type_index": 0, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, } ) @@ -1765,7 +1765,7 @@ def test_groups_aggregating(self): "aggregation_group_type_index": 0, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, }, actor="group", @@ -1778,7 +1778,7 @@ def test_groups_aggregating(self): "aggregation_group_type_index": 1, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, } ) @@ -1805,7 +1805,7 @@ def test_groups_in_period(self): "aggregation_group_type_index": 0, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, }, actor="group", @@ -1827,7 +1827,7 @@ def test_groups_aggregating_person_on_events(self): "aggregation_group_type_index": 0, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, } ) @@ -1851,7 +1851,7 @@ def test_groups_aggregating_person_on_events(self): "aggregation_group_type_index": 0, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, }, actor="group", @@ -1865,7 +1865,7 @@ def test_groups_aggregating_person_on_events(self): "aggregation_group_type_index": 1, "retentionFilter": { "period": "Week", - "total_intervals": 7, + "totalIntervals": 7, }, } )