From f239b1f569a997843b99a75296b2c836b5556e7f Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 31 Mar 2024 00:04:39 +0000 Subject: [PATCH] Update query snapshots --- .../test/__snapshots__/test_usage_report.ambr | 106 ++++++++++-------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/posthog/tasks/test/__snapshots__/test_usage_report.ambr b/posthog/tasks/test/__snapshots__/test_usage_report.ambr index 4e5039c1df0b1..e2038e3de9f89 100644 --- a/posthog/tasks/test/__snapshots__/test_usage_report.ambr +++ b/posthog/tasks/test/__snapshots__/test_usage_report.ambr @@ -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 @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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 @@ -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, @@ -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, @@ -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, @@ -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, @@ -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 ''' @@ -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 '''