Skip to content

Commit

Permalink
Merge branch 'master' into feat/schedule-feature-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik authored Dec 22, 2023
2 parents 6c837af + 8c6a033 commit 588c3f6
Show file tree
Hide file tree
Showing 66 changed files with 636 additions and 525 deletions.
58 changes: 29 additions & 29 deletions ee/clickhouse/queries/funnels/test/__snapshots__/test_funnel.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -160,7 +160,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -299,7 +299,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -437,7 +437,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -572,7 +572,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -707,7 +707,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -842,7 +842,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -979,7 +979,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1120,7 +1120,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1259,7 +1259,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1397,7 +1397,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1510,7 +1510,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1623,7 +1623,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1736,7 +1736,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1851,7 +1851,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -1992,7 +1992,7 @@
AND notEmpty(e.person_id)
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2131,7 +2131,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2269,7 +2269,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2292,7 +2292,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2315,7 +2315,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2547,7 +2547,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2570,7 +2570,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2593,7 +2593,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -2825,7 +2825,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2848,7 +2848,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -2871,7 +2871,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -3103,7 +3103,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -3126,7 +3126,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand All @@ -3149,7 +3149,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-08 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
OR NOT JSONHas(group_properties_0, 'out')))
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 5
LIMIT 6
OFFSET 0
'
---
Expand All @@ -44,7 +44,7 @@
OR NOT JSONHas(group_properties_0, 'out')))
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 5
LIMIT 6
OFFSET 0
'
---
Expand Down Expand Up @@ -74,7 +74,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-04 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 5
LIMIT 6
OFFSET 0
'
---
Expand Down Expand Up @@ -104,7 +104,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-04 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 5
LIMIT 6
OFFSET 0
'
---
Expand Down Expand Up @@ -142,7 +142,7 @@
OR has(['val'], replaceRegexpAll(JSONExtractRaw(e.properties, 'key'), '^"|"$', ''))))
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 5
LIMIT 6
OFFSET 0
'
---
Expand All @@ -167,7 +167,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-12 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -206,7 +206,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-12 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
Expand Down Expand Up @@ -245,7 +245,7 @@
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-12 23:59:59', 'UTC')
GROUP BY value
ORDER BY count DESC, value DESC
LIMIT 25
LIMIT 26
OFFSET 0
'
---
16 changes: 8 additions & 8 deletions ee/clickhouse/queries/test/test_breakdown_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_breakdown_person_props(self):
"count(*)",
self.team,
)
self.assertEqual(res, ["test"])
self.assertEqual(res[0], ["test"])

def test_breakdown_person_props_with_entity_filter(self):
_create_person(team_id=self.team.pk, distinct_ids=["p1"], properties={"$browser": "test"})
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_breakdown_person_props_with_entity_filter(self):
}
)
res = get_breakdown_prop_values(filter, Entity(entity_params[0]), "count(*)", self.team)
self.assertEqual(res, ["test"])
self.assertEqual(res[0], ["test"])

@snapshot_clickhouse_queries
def test_breakdown_person_props_with_entity_filter_and_or_props_with_partial_pushdown(self):
Expand Down Expand Up @@ -242,7 +242,7 @@ def test_breakdown_person_props_with_entity_filter_and_or_props_with_partial_pus
"funnel_window_days": 14,
}
)
res = sorted(get_breakdown_prop_values(filter, Entity(entity_params[0]), "count(*)", self.team))
res = sorted(get_breakdown_prop_values(filter, Entity(entity_params[0]), "count(*)", self.team)[0])
self.assertEqual(res, ["test", "test2"])

@snapshot_clickhouse_queries
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_breakdown_group_props(self):
team=self.team,
)
result = get_breakdown_prop_values(filter, filter.entities[0], "count(*)", self.team)
self.assertEqual(result, ["finance", "technology"])
self.assertEqual(result[0], ["finance", "technology"])

filter = Filter(
data={
Expand All @@ -345,7 +345,7 @@ def test_breakdown_group_props(self):
}
)
result = get_breakdown_prop_values(filter, filter.entities[0], "count(*)", self.team)
self.assertEqual(result, ["finance", "technology"])
self.assertEqual(result[0], ["finance", "technology"])

@snapshot_clickhouse_queries
def test_breakdown_session_props(self):
Expand Down Expand Up @@ -397,7 +397,7 @@ def test_breakdown_session_props(self):
}
)
result = get_breakdown_prop_values(filter, filter.entities[0], "count(*)", self.team)
self.assertEqual(result, [70, 20])
self.assertEqual(result[0], [70, 20])

@snapshot_clickhouse_queries
def test_breakdown_with_math_property_session(self):
Expand Down Expand Up @@ -511,10 +511,10 @@ def test_breakdown_with_math_property_session(self):
result = get_breakdown_prop_values(filter, filter.entities[0], aggregate_operation, self.team)
# test should come first, based on aggregate operation, even if absolute count of events for
# mac is higher
self.assertEqual(result, ["test", "mac"])
self.assertEqual(result[0], ["test", "mac"])

result = get_breakdown_prop_values(filter, filter.entities[0], "count(*)", self.team)
self.assertEqual(result, ["mac", "test"])
self.assertEqual(result[0], ["mac", "test"])


@pytest.mark.parametrize(
Expand Down
Loading

0 comments on commit 588c3f6

Please sign in to comment.