Skip to content

Commit

Permalink
Merge branch 'master' into fix/validate-tokens-check
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Dec 13, 2024
2 parents 3898b26 + 8f6d880 commit b901841
Show file tree
Hide file tree
Showing 9 changed files with 2,127 additions and 960 deletions.
657 changes: 537 additions & 120 deletions ee/clickhouse/views/test/__snapshots__/test_clickhouse_experiments.ambr

Large diffs are not rendered by default.

58 changes: 32 additions & 26 deletions posthog/api/test/__snapshots__/test_event.ambr
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# serializer version: 1
# name: TestEvents.test_event_property_values
'''
/* celery:posthog.tasks.tasks.sync_insight_caching_state */
SELECT team_id,
date_diff('second', max(timestamp), now()) AS age
/* user_id:0 request:_snapshot_ */
SELECT DISTINCT replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '')
FROM events
WHERE timestamp > date_sub(DAY, 3, now())
AND timestamp < now()
GROUP BY team_id
ORDER BY age;
WHERE team_id = 99999
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
LIMIT 10
'''
# ---
# name: TestEvents.test_event_property_values.1
Expand All @@ -20,6 +20,8 @@
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%qw%'
order by length(replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', ''))
LIMIT 10
'''
# ---
Expand All @@ -32,7 +34,7 @@
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%qw%'
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%QW%'
order by length(replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', ''))
LIMIT 10
'''
Expand All @@ -46,7 +48,7 @@
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%QW%'
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%6%'
order by length(replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', ''))
LIMIT 10
'''
Expand All @@ -60,6 +62,7 @@
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND (event = 'random event')
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%6%'
order by length(replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', ''))
LIMIT 10
Expand All @@ -74,7 +77,8 @@
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND (event = 'random event')
AND (event = 'foo'
OR event = 'random event')
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%6%'
order by length(replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', ''))
LIMIT 10
Expand All @@ -89,9 +93,8 @@
AND JSONHas(properties, 'random_prop')
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND (event = 'foo'
OR event = 'random event')
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%6%'
AND (event = '404_i_dont_exist')
AND replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', '') ILIKE '%qw%'
order by length(replaceRegexpAll(JSONExtractRaw(properties, 'random_prop'), '^"|"$', ''))
LIMIT 10
'''
Expand All @@ -113,14 +116,14 @@
# ---
# name: TestEvents.test_event_property_values_materialized
'''
/* celery:posthog.tasks.tasks.sync_insight_caching_state */
SELECT team_id,
date_diff('second', max(timestamp), now()) AS age
/* user_id:0 request:_snapshot_ */
SELECT DISTINCT "mat_random_prop"
FROM events
WHERE timestamp > date_sub(DAY, 3, now())
AND timestamp < now()
GROUP BY team_id
ORDER BY age;
WHERE team_id = 99999
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
LIMIT 10
'''
# ---
# name: TestEvents.test_event_property_values_materialized.1
Expand All @@ -132,6 +135,8 @@
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND "mat_random_prop" ILIKE '%qw%'
order by length("mat_random_prop")
LIMIT 10
'''
# ---
Expand All @@ -144,7 +149,7 @@
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND "mat_random_prop" ILIKE '%qw%'
AND "mat_random_prop" ILIKE '%QW%'
order by length("mat_random_prop")
LIMIT 10
'''
Expand All @@ -158,7 +163,7 @@
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND "mat_random_prop" ILIKE '%QW%'
AND "mat_random_prop" ILIKE '%6%'
order by length("mat_random_prop")
LIMIT 10
'''
Expand All @@ -172,6 +177,7 @@
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND (event = 'random event')
AND "mat_random_prop" ILIKE '%6%'
order by length("mat_random_prop")
LIMIT 10
Expand All @@ -186,7 +192,8 @@
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND (event = 'random event')
AND (event = 'foo'
OR event = 'random event')
AND "mat_random_prop" ILIKE '%6%'
order by length("mat_random_prop")
LIMIT 10
Expand All @@ -201,9 +208,8 @@
AND notEmpty("mat_random_prop")
AND timestamp >= '2020-01-13 00:00:00'
AND timestamp <= '2020-01-20 23:59:59'
AND (event = 'foo'
OR event = 'random event')
AND "mat_random_prop" ILIKE '%6%'
AND (event = '404_i_dont_exist')
AND "mat_random_prop" ILIKE '%qw%'
order by length("mat_random_prop")
LIMIT 10
'''
Expand Down
2 changes: 1 addition & 1 deletion posthog/api/test/dashboards/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ def test_create_from_template_json_can_provide_query_tile(self) -> None:
"effective_privilege_level": 37,
"effective_restriction_level": 21,
"favorited": False,
"filters": {"filter_test_accounts": True},
"filters": {},
"filters_hash": ANY,
"hasMore": None,
"id": ANY,
Expand Down
Loading

0 comments on commit b901841

Please sign in to comment.