Skip to content

Commit

Permalink
Update query snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 31, 2024
1 parent 3f78334 commit f239b1f
Showing 1 changed file with 60 additions and 46 deletions.
106 changes: 60 additions & 46 deletions posthog/tasks/test/__snapshots__/test_usage_report.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.10
'''

SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='local evaluation usage'
AND timestamp between '2022-01-01 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.11
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
JSONExtractString(log_comment, 'access_method') as access_method
Expand All @@ -39,7 +52,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.11
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.12
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -56,7 +69,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.12
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.13
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -73,7 +86,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.13
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.14
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -90,7 +103,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.14
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.15
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -107,7 +120,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.15
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.16
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -124,7 +137,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.16
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.17
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -141,7 +154,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.17
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.18
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -158,7 +171,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.18
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.19
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -175,7 +188,21 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.19
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.2
'''

SELECT team_id,
count(distinct toDate(timestamp), event, cityHash64(distinct_id), cityHash64(uuid)) as count
FROM events
WHERE timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND event != '$feature_flag_called'
AND event NOT IN ('survey sent',
'survey shown',
'survey dismissed')
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.20
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -192,21 +219,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.2
'''

SELECT team_id,
count(1) as count
FROM events
WHERE timestamp between '2022-01-01 00:00:00' AND '2022-01-10 23:59:59'
AND event != '$feature_flag_called'
AND event NOT IN ('survey sent',
'survey shown',
'survey dismissed')
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.20
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.21
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -223,7 +236,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.21
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.22
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -240,7 +253,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.22
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.23
'''

SELECT team_id,
Expand All @@ -251,7 +264,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.23
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.24
'''

SELECT team_id,
Expand All @@ -262,7 +275,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.24
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.25
'''

SELECT team,
Expand All @@ -283,6 +296,20 @@
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.3
'''

SELECT team_id,
count(1) as count
FROM events
WHERE timestamp between '2022-01-01 00:00:00' AND '2022-01-10 23:59:59'
AND event != '$feature_flag_called'
AND event NOT IN ('survey sent',
'survey shown',
'survey dismissed')
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.4
'''

SELECT team_id,
count(1) as count
FROM events
Expand All @@ -295,7 +322,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.4
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.5
'''

SELECT team_id,
Expand All @@ -310,7 +337,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.5
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.6
'''

SELECT team_id,
Expand All @@ -319,7 +346,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.6
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.7
'''

SELECT distinct_id as team,
Expand All @@ -332,7 +359,7 @@
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.7
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.8
'''

SELECT distinct_id as team,
Expand All @@ -345,19 +372,6 @@
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.8
'''

SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='local evaluation usage'
AND timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.9
'''

Expand All @@ -366,7 +380,7 @@
FROM events
WHERE team_id = 2
AND event='local evaluation usage'
AND timestamp between '2022-01-01 00:00:00' AND '2022-01-10 23:59:59'
AND timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
Expand Down

0 comments on commit f239b1f

Please sign in to comment.