Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Jan 17, 2024
1 parent 4339504 commit e47f95d
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions posthog/hogql_queries/insights/test/test_retention_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
)
Expand Down Expand Up @@ -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,
},
}
)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
},
}
)
Expand Down Expand Up @@ -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,
},
}
)
Expand Down Expand Up @@ -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,
},
},
)
Expand All @@ -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,
},
},
)
Expand Down Expand Up @@ -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,
},
},
)
Expand Down Expand Up @@ -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"},
},
}
)
Expand Down Expand Up @@ -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"},
},
}
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"},
},
}
)
Expand Down Expand Up @@ -1233,7 +1233,7 @@ def test_retention_with_user_properties(self):
],
},
"retentionFilter": {
"total_intervals": 7,
"totalIntervals": 7,
},
}
)
Expand Down Expand Up @@ -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"},
},
}
)
Expand Down Expand Up @@ -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},
},
}
)
Expand Down Expand Up @@ -1741,7 +1741,7 @@ def test_groups_aggregating(self):
"aggregation_group_type_index": 0,
"retentionFilter": {
"period": "Week",
"total_intervals": 7,
"totalIntervals": 7,
},
}
)
Expand All @@ -1765,7 +1765,7 @@ def test_groups_aggregating(self):
"aggregation_group_type_index": 0,
"retentionFilter": {
"period": "Week",
"total_intervals": 7,
"totalIntervals": 7,
},
},
actor="group",
Expand All @@ -1778,7 +1778,7 @@ def test_groups_aggregating(self):
"aggregation_group_type_index": 1,
"retentionFilter": {
"period": "Week",
"total_intervals": 7,
"totalIntervals": 7,
},
}
)
Expand All @@ -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",
Expand All @@ -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,
},
}
)
Expand All @@ -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",
Expand All @@ -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,
},
}
)
Expand Down

0 comments on commit e47f95d

Please sign in to comment.