Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(insights): match cohort filters on warehouse series via distinct_id (#100796)

Thomas Obermüller2d0ffd8a54f6
diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
index a941bc3f4581..5ec3624952cc 100644
--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr
@@ -4300,6 +4300,171 @@
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.100
+ '''
+ SELECT "posthog_insightvariable"."id",
+ "posthog_insightvariable"."name",
+ "posthog_insightvariable"."code_name",
+ "posthog_insightvariable"."type",
+ "posthog_insightvariable"."default_value",
+ "posthog_insightvariable"."is_multi"
+ FROM "posthog_insightvariable"
+ INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_insightvariable"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_insightvariable"."team_id" = 99999))
+ ORDER BY "posthog_insightvariable"."name" ASC
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.101
+ '''
+ SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.102
+ '''
+ SELECT "posthog_dashboard"."id",
+ "posthog_dashboard"."name",
+ "posthog_dashboard"."description",
+ "posthog_dashboard"."team_id",
+ "posthog_dashboard"."pinned",
+ "posthog_dashboard"."created_at",
+ "posthog_dashboard"."created_by_id",
+ "posthog_dashboard"."deleted",
+ "posthog_dashboard"."last_accessed_at",
+ "posthog_dashboard"."last_refresh",
+ "posthog_dashboard"."filters",
+ "posthog_dashboard"."variables",
+ "posthog_dashboard"."breakdown_colors",
+ "posthog_dashboard"."data_color_theme_id",
+ "posthog_dashboard"."creation_mode",
+ "posthog_dashboard"."restriction_level",
+ "posthog_dashboard"."quick_filter_ids",
+ "posthog_dashboard"."customization",
+ "posthog_dashboard"."deprecated_tags",
+ "posthog_dashboard"."tags",
+ "posthog_dashboard"."share_token",
+ "posthog_dashboard"."is_shared"
+ FROM "posthog_dashboard"
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboard"."id" IN (1,
+ 2,
+ 3,
+ 4,
+ 5 /* ... */))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.103
+ '''
+ SELECT "posthog_tag"."name" AS "tag__name"
+ FROM "posthog_taggeditem"
+ INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.104
+ '''
+ SELECT "posthog_user"."id",
+ "posthog_user"."password",
+ "posthog_user"."last_login",
+ "posthog_user"."first_name",
+ "posthog_user"."last_name",
+ "posthog_user"."is_staff",
+ "posthog_user"."date_joined",
+ "posthog_user"."uuid",
+ "posthog_user"."current_organization_id",
+ "posthog_user"."current_team_id",
+ "posthog_user"."email",
+ "posthog_user"."pending_email",
+ "posthog_user"."distinct_id",
+ "posthog_user"."is_email_verified",
+ "posthog_user"."credentials_reviewed_at",
+ "posthog_user"."requested_2fa_reset_at",
+ "posthog_user"."has_seen_product_intro_for",
+ "posthog_user"."strapi_id",
+ "posthog_user"."is_active",
+ "posthog_user"."role_at_organization",
+ "posthog_user"."theme_mode",
+ "posthog_user"."partial_notification_settings",
+ "posthog_user"."anonymize_data",
+ "posthog_user"."allow_impersonation",
+ "posthog_user"."toolbar_mode",
+ "posthog_user"."hedgehog_config",
+ "posthog_user"."allow_sidebar_suggestions",
+ "posthog_user"."shortcut_position",
+ "posthog_user"."passkeys_enabled_for_2fa",
+ "posthog_user"."hide_mcp_hints",
+ "posthog_user"."ui_configuration",
+ "posthog_user"."onboarding_skipped_at",
+ "posthog_user"."onboarding_skipped_reason",
+ "posthog_user"."onboarding_skipped_organization_id",
+ "posthog_user"."onboarding_delegated_to_invite_id",
+ "posthog_user"."onboarding_delegated_to_organization_id",
+ "posthog_user"."onboarding_delegation_accepted_at",
+ "posthog_user"."events_column_config",
+ "posthog_user"."email_opt_in"
+ FROM "posthog_user"
+ WHERE ("posthog_user"."is_active"
+ AND "posthog_user"."id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.105
+ '''
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.106
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4438,7 +4603,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.101
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.107
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4493,7 +4658,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.102
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.108
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -4516,7 +4681,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.103
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.109
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -4569,7 +4734,19 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.104
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.11
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."dashboard_id" = 99999
+ AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.110
'''
SELECT "ee_accesscontrol"."team_id" AS "team_id",
"ee_accesscontrol"."resource_id" AS "resource_id",
@@ -4582,7 +4759,7 @@
AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.105
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.111
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -4594,7 +4771,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.106
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.112
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -4614,7 +4791,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.107
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.113
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -4627,7 +4804,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.108
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.114
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -4640,7 +4817,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.109
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.115
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -4673,19 +4850,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.11
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."dashboard_id" = 99999
- AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.110
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.116
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4784,7 +4949,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.111
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.117
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -4830,7 +4995,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.112
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.118
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -4842,7 +5007,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.113
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.119
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -4941,7 +5106,26 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.114
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.12
+ '''
+ SELECT "posthog_sharingconfiguration"."id",
+ "posthog_sharingconfiguration"."team_id",
+ "posthog_sharingconfiguration"."dashboard_id",
+ "posthog_sharingconfiguration"."insight_id",
+ "posthog_sharingconfiguration"."recording_id",
+ "posthog_sharingconfiguration"."notebook_id",
+ "posthog_sharingconfiguration"."interviewee_context_id",
+ "posthog_sharingconfiguration"."created_at",
+ "posthog_sharingconfiguration"."enabled",
+ "posthog_sharingconfiguration"."access_token",
+ "posthog_sharingconfiguration"."expires_at",
+ "posthog_sharingconfiguration"."settings",
+ "posthog_sharingconfiguration"."password_required"
+ FROM "posthog_sharingconfiguration"
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.120
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -4966,7 +5150,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.115
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.121
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -4984,7 +5168,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.116
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.122
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5030,7 +5214,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.117
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.123
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5129,7 +5313,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.118
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.124
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5156,7 +5340,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.119
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.125
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -5183,26 +5367,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.12
- '''
- SELECT "posthog_sharingconfiguration"."id",
- "posthog_sharingconfiguration"."team_id",
- "posthog_sharingconfiguration"."dashboard_id",
- "posthog_sharingconfiguration"."insight_id",
- "posthog_sharingconfiguration"."recording_id",
- "posthog_sharingconfiguration"."notebook_id",
- "posthog_sharingconfiguration"."interviewee_context_id",
- "posthog_sharingconfiguration"."created_at",
- "posthog_sharingconfiguration"."enabled",
- "posthog_sharingconfiguration"."access_token",
- "posthog_sharingconfiguration"."expires_at",
- "posthog_sharingconfiguration"."settings",
- "posthog_sharingconfiguration"."password_required"
- FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.120
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.126
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -5222,7 +5387,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.121
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.127
'''
SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
FROM "posthog_dashboardtile"
@@ -5233,7 +5398,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.122
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.128
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -5266,7 +5431,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.123
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.129
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -5275,7 +5440,18 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.124
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.13
+ '''
+ SELECT "django_content_type"."id",
+ "django_content_type"."app_label",
+ "django_content_type"."model"
+ FROM "django_content_type"
+ WHERE ("django_content_type"."app_label" = 'dashboards'
+ AND "django_content_type"."model" = 'dashboard')
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.130
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -5321,7 +5497,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.125
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.131
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5367,7 +5543,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.126
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.132
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5506,7 +5682,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.127
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.133
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5561,7 +5737,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.128
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.134
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -5584,7 +5760,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.129
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.135
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -5637,15 +5813,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.13
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_taggeditem"
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.130
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.136
'''
SELECT "ee_accesscontrol"."team_id" AS "team_id",
"ee_accesscontrol"."resource_id" AS "resource_id",
@@ -5658,7 +5826,7 @@
AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.131
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.137
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -5670,7 +5838,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.132
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.138
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -5690,7 +5858,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.133
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.139
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -5703,7 +5871,15 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.134
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.14
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_taggeditem"
+ WHERE ("posthog_taggeditem"."content_type_id" = 99999
+ AND "posthog_taggeditem"."object_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.140
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -5716,7 +5892,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.135
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.141
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -5749,7 +5925,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.136
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.142
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -5848,7 +6024,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.137
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.143
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -5894,7 +6070,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.138
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.144
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -5906,7 +6082,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.139
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.145
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6005,23 +6181,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.14
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.140
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.146
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -6046,7 +6206,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.141
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.147
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -6064,7 +6224,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.142
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.148
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6110,7 +6270,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.143
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.149
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6209,7 +6369,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.144
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.15
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.150
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6236,7 +6412,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.145
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.151
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -6263,7 +6439,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.146
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.152
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -6283,7 +6459,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.147
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.153
'''
SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
FROM "posthog_dashboardtile"
@@ -6294,7 +6470,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.148
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.154
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -6327,7 +6503,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.149
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.155
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -6336,23 +6512,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.15
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.150
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.156
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -6398,7 +6558,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.151
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.157
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -6444,7 +6604,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.152
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.158
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -6583,7 +6743,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.153
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.159
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6638,7 +6798,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.154
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.16
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.160
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -6661,7 +6837,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.155
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.161
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -6714,7 +6890,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.156
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.162
'''
SELECT "ee_accesscontrol"."team_id" AS "team_id",
"ee_accesscontrol"."resource_id" AS "resource_id",
@@ -6727,7 +6903,7 @@
AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.157
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.163
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -6739,7 +6915,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.158
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.164
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -6842,7 +7018,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.159
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.165
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -6865,23 +7041,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.16
- '''
- SELECT "posthog_filesystem"."id" AS "id",
- "posthog_filesystem"."path" AS "path"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'dashboard'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
- ORDER BY 1 ASC
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.160
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.166
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7242,7 +7402,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.161
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.167
'''
SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",
"posthog_dashboard"."id",
@@ -7284,7 +7444,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.162
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.168
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7315,7 +7475,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.163
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.169
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -7344,7 +7504,23 @@
2)/* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.164
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.17
+ '''
+ SELECT "posthog_filesystem"."id" AS "id",
+ "posthog_filesystem"."path" AS "path"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'dashboard'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ ORDER BY 1 ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.170
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -7365,7 +7541,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.165
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.171
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -7464,7 +7640,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.166
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.172
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -7489,7 +7665,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.167
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.173
'''
SELECT "posthog_filesystemshortcut"."id",
"posthog_filesystemshortcut"."team_id",
@@ -7512,7 +7688,7 @@
AND "posthog_filesystemshortcut"."href" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.168
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.174
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -7532,7 +7708,7 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.169
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.175
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7894,26 +8070,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.17
- '''
- SELECT "posthog_sharingconfiguration"."id",
- "posthog_sharingconfiguration"."team_id",
- "posthog_sharingconfiguration"."dashboard_id",
- "posthog_sharingconfiguration"."insight_id",
- "posthog_sharingconfiguration"."recording_id",
- "posthog_sharingconfiguration"."notebook_id",
- "posthog_sharingconfiguration"."interviewee_context_id",
- "posthog_sharingconfiguration"."created_at",
- "posthog_sharingconfiguration"."enabled",
- "posthog_sharingconfiguration"."access_token",
- "posthog_sharingconfiguration"."expires_at",
- "posthog_sharingconfiguration"."settings",
- "posthog_sharingconfiguration"."password_required"
- FROM "posthog_sharingconfiguration"
- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.170
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.176
'''
SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",
"posthog_dashboard"."id",
@@ -7955,7 +8112,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.171
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.177
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -7986,7 +8143,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.172
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.178
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -8015,7 +8172,7 @@
2)/* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.173
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.179
'''
SELECT "posthog_taggeditem"."id",
"posthog_taggeditem"."tag_id",
@@ -8036,13 +8193,32 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.174
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.18
'''
- SELECT "posthog_alertconfiguration"."created_by_id",
- "posthog_alertconfiguration"."created_at",
- "posthog_alertconfiguration"."id",
- "posthog_alertconfiguration"."team_id",
- "posthog_alertconfiguration"."insight_id",
+ SELECT "posthog_sharingconfiguration"."id",
+ "posthog_sharingconfiguration"."team_id",
+ "posthog_sharingconfiguration"."dashboard_id",
+ "posthog_sharingconfiguration"."insight_id",
+ "posthog_sharingconfiguration"."recording_id",
+ "posthog_sharingconfiguration"."notebook_id",
+ "posthog_sharingconfiguration"."interviewee_context_id",
+ "posthog_sharingconfiguration"."created_at",
+ "posthog_sharingconfiguration"."enabled",
+ "posthog_sharingconfiguration"."access_token",
+ "posthog_sharingconfiguration"."expires_at",
+ "posthog_sharingconfiguration"."settings",
+ "posthog_sharingconfiguration"."password_required"
+ FROM "posthog_sharingconfiguration"
+ WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.180
+ '''
+ SELECT "posthog_alertconfiguration"."created_by_id",
+ "posthog_alertconfiguration"."created_at",
+ "posthog_alertconfiguration"."id",
+ "posthog_alertconfiguration"."team_id",
+ "posthog_alertconfiguration"."insight_id",
"posthog_alertconfiguration"."name",
"posthog_alertconfiguration"."config",
"posthog_alertconfiguration"."evaluation_delay_intervals",
@@ -8119,7 +8295,7 @@
5 /* ... */)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.175
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.181
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -8152,7 +8328,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.18
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.19
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -8172,7 +8348,146 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.19
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.2
+ '''
+ SELECT "posthog_team"."id",
+ "posthog_team"."uuid",
+ "posthog_team"."organization_id",
+ "posthog_team"."parent_team_id",
+ "posthog_team"."project_id",
+ "posthog_team"."api_token",
+ "posthog_team"."app_urls",
+ "posthog_team"."name",
+ "posthog_team"."slack_incoming_webhook",
+ "posthog_team"."created_at",
+ "posthog_team"."updated_at",
+ "posthog_team"."anonymize_ips",
+ "posthog_team"."completed_snippet_onboarding",
+ "posthog_team"."has_completed_onboarding_for",
+ "posthog_team"."onboarding_tasks",
+ "posthog_team"."ingested_event",
+ "posthog_team"."ingested_production_event",
+ "posthog_team"."ingested_production_event_last_checked_at",
+ "posthog_team"."person_processing_opt_out",
+ "posthog_team"."secret_api_token",
+ "posthog_team"."secret_api_token_backup",
+ "posthog_team"."session_recording_opt_in",
+ "posthog_team"."session_recording_sample_rate",
+ "posthog_team"."session_recording_minimum_duration_milliseconds",
+ "posthog_team"."session_recording_linked_flag",
+ "posthog_team"."session_recording_network_payload_capture_config",
+ "posthog_team"."session_recording_masking_config",
+ "posthog_team"."session_recording_url_trigger_config",
+ "posthog_team"."session_recording_url_blocklist_config",
+ "posthog_team"."session_recording_event_trigger_config",
+ "posthog_team"."session_recording_trigger_match_type_config",
+ "posthog_team"."session_recording_trigger_groups",
+ "posthog_team"."session_replay_config",
+ "posthog_team"."session_recording_retention_period",
+ "posthog_team"."event_retention_months",
+ "posthog_team"."conversations_enabled",
+ "posthog_team"."conversations_settings",
+ "posthog_team"."proactive_tasks_enabled",
+ "posthog_team"."survey_config",
+ "posthog_team"."surveys_opt_in",
+ "posthog_team"."product_tours_opt_in",
+ "posthog_team"."capture_console_log_opt_in",
+ "posthog_team"."capture_performance_opt_in",
+ "posthog_team"."capture_dead_clicks",
+ "posthog_team"."autocapture_opt_out",
+ "posthog_team"."autocapture_web_vitals_opt_in",
+ "posthog_team"."autocapture_web_vitals_allowed_metrics",
+ "posthog_team"."autocapture_exceptions_opt_in",
+ "posthog_team"."autocapture_exceptions_errors_to_ignore",
+ "posthog_team"."logs_settings",
+ "posthog_team"."llm_gateway_enabled_at",
+ "posthog_team"."llm_gateway_revoked_at",
+ "posthog_team"."llm_gateway_overspend_allowance_usd",
+ "posthog_team"."heatmaps_opt_in",
+ "posthog_team"."receive_org_level_activity_logs",
+ "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
+ "posthog_team"."web_analytics_pre_aggregated_tables_version",
+ "posthog_team"."flags_persistence_default",
+ "posthog_team"."feature_flag_confirmation_enabled",
+ "posthog_team"."feature_flag_confirmation_message",
+ "posthog_team"."default_evaluation_environments_enabled",
+ "posthog_team"."require_evaluation_environment_tags",
+ "posthog_team"."default_evaluation_contexts_enabled",
+ "posthog_team"."require_evaluation_contexts",
+ "posthog_team"."session_recording_version",
+ "posthog_team"."signup_token",
+ "posthog_team"."is_demo",
+ "posthog_team"."access_control",
+ "posthog_team"."week_start_day",
+ "posthog_team"."inject_web_apps",
+ "posthog_team"."test_account_filters",
+ "posthog_team"."test_account_filters_default_checked",
+ "posthog_team"."path_cleaning_filters",
+ "posthog_team"."timezone",
+ "posthog_team"."data_attributes",
+ "posthog_team"."person_display_name_properties",
+ "posthog_team"."live_events_columns",
+ "posthog_team"."recording_domains",
+ "posthog_team"."human_friendly_comparison_periods",
+ "posthog_team"."cookieless_server_hash_mode",
+ "posthog_team"."primary_dashboard_id",
+ "posthog_team"."default_data_theme",
+ "posthog_team"."extra_settings",
+ "posthog_team"."modifiers",
+ "posthog_team"."correlation_config",
+ "posthog_team"."session_recording_retention_period_days",
+ "posthog_team"."external_data_workspace_id",
+ "posthog_team"."external_data_workspace_last_synced_at",
+ "posthog_team"."api_query_rate_limit",
+ "posthog_team"."drop_events_older_than",
+ "posthog_team"."base_currency",
+ "posthog_team"."business_model",
+ "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_team"
+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
+ WHERE "posthog_team"."id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.20
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -8528,146 +8843,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.2
- '''
- SELECT "posthog_team"."id",
- "posthog_team"."uuid",
- "posthog_team"."organization_id",
- "posthog_team"."parent_team_id",
- "posthog_team"."project_id",
- "posthog_team"."api_token",
- "posthog_team"."app_urls",
- "posthog_team"."name",
- "posthog_team"."slack_incoming_webhook",
- "posthog_team"."created_at",
- "posthog_team"."updated_at",
- "posthog_team"."anonymize_ips",
- "posthog_team"."completed_snippet_onboarding",
- "posthog_team"."has_completed_onboarding_for",
- "posthog_team"."onboarding_tasks",
- "posthog_team"."ingested_event",
- "posthog_team"."ingested_production_event",
- "posthog_team"."ingested_production_event_last_checked_at",
- "posthog_team"."person_processing_opt_out",
- "posthog_team"."secret_api_token",
- "posthog_team"."secret_api_token_backup",
- "posthog_team"."session_recording_opt_in",
- "posthog_team"."session_recording_sample_rate",
- "posthog_team"."session_recording_minimum_duration_milliseconds",
- "posthog_team"."session_recording_linked_flag",
- "posthog_team"."session_recording_network_payload_capture_config",
- "posthog_team"."session_recording_masking_config",
- "posthog_team"."session_recording_url_trigger_config",
- "posthog_team"."session_recording_url_blocklist_config",
- "posthog_team"."session_recording_event_trigger_config",
- "posthog_team"."session_recording_trigger_match_type_config",
- "posthog_team"."session_recording_trigger_groups",
- "posthog_team"."session_replay_config",
- "posthog_team"."session_recording_retention_period",
- "posthog_team"."event_retention_months",
- "posthog_team"."conversations_enabled",
- "posthog_team"."conversations_settings",
- "posthog_team"."proactive_tasks_enabled",
- "posthog_team"."survey_config",
- "posthog_team"."surveys_opt_in",
- "posthog_team"."product_tours_opt_in",
- "posthog_team"."capture_console_log_opt_in",
- "posthog_team"."capture_performance_opt_in",
- "posthog_team"."capture_dead_clicks",
- "posthog_team"."autocapture_opt_out",
- "posthog_team"."autocapture_web_vitals_opt_in",
- "posthog_team"."autocapture_web_vitals_allowed_metrics",
- "posthog_team"."autocapture_exceptions_opt_in",
- "posthog_team"."autocapture_exceptions_errors_to_ignore",
- "posthog_team"."logs_settings",
- "posthog_team"."llm_gateway_enabled_at",
- "posthog_team"."llm_gateway_revoked_at",
- "posthog_team"."llm_gateway_overspend_allowance_usd",
- "posthog_team"."heatmaps_opt_in",
- "posthog_team"."receive_org_level_activity_logs",
- "posthog_team"."web_analytics_pre_aggregated_tables_enabled",
- "posthog_team"."web_analytics_pre_aggregated_tables_version",
- "posthog_team"."flags_persistence_default",
- "posthog_team"."feature_flag_confirmation_enabled",
- "posthog_team"."feature_flag_confirmation_message",
- "posthog_team"."default_evaluation_environments_enabled",
- "posthog_team"."require_evaluation_environment_tags",
- "posthog_team"."default_evaluation_contexts_enabled",
- "posthog_team"."require_evaluation_contexts",
- "posthog_team"."session_recording_version",
- "posthog_team"."signup_token",
- "posthog_team"."is_demo",
- "posthog_team"."access_control",
- "posthog_team"."week_start_day",
- "posthog_team"."inject_web_apps",
- "posthog_team"."test_account_filters",
- "posthog_team"."test_account_filters_default_checked",
- "posthog_team"."path_cleaning_filters",
- "posthog_team"."timezone",
- "posthog_team"."data_attributes",
- "posthog_team"."person_display_name_properties",
- "posthog_team"."live_events_columns",
- "posthog_team"."recording_domains",
- "posthog_team"."human_friendly_comparison_periods",
- "posthog_team"."cookieless_server_hash_mode",
- "posthog_team"."primary_dashboard_id",
- "posthog_team"."default_data_theme",
- "posthog_team"."extra_settings",
- "posthog_team"."modifiers",
- "posthog_team"."correlation_config",
- "posthog_team"."session_recording_retention_period_days",
- "posthog_team"."external_data_workspace_id",
- "posthog_team"."external_data_workspace_last_synced_at",
- "posthog_team"."api_query_rate_limit",
- "posthog_team"."drop_events_older_than",
- "posthog_team"."base_currency",
- "posthog_team"."business_model",
- "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_team"
- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")
- WHERE "posthog_team"."id" = 99999
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.20
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.21
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -8676,7 +8852,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.21
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.22
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -8722,7 +8898,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.22
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.23
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -8768,7 +8944,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.23
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.24
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -8907,7 +9083,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.24
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.25
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -8962,7 +9138,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.25
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.26
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -8985,7 +9161,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.26
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.27
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -9038,7 +9214,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.27
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.28
'''
SELECT "ee_accesscontrol"."team_id" AS "team_id",
"ee_accesscontrol"."resource_id" AS "resource_id",
@@ -9051,7 +9227,7 @@
AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.28
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.29
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -9063,22 +9239,6 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.29
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND ("posthog_dashboard"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_dashboard"."team_id" = 99999))
- AND NOT "posthog_dashboard"."deleted")
- '''
-# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.3
'''
SELECT "posthog_organizationmembership"."id",
@@ -9135,6 +9295,22 @@
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.30
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND ("posthog_dashboard"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_dashboard"."team_id" = 99999))
+ AND NOT "posthog_dashboard"."deleted")
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.31
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -9233,7 +9409,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.31
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.32
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -9258,7 +9434,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.32
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.33
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -9270,7 +9446,7 @@
AND NOT ("posthog_dashboardtile"."insight_id" IS NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.33
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.34
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -9289,7 +9465,7 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.34
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.35
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_taggeditem"
@@ -9297,7 +9473,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.35
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.36
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -9313,7 +9489,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.36
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.37
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -9329,7 +9505,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.37
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.38
'''
SELECT "posthog_filesystem"."id" AS "id",
"posthog_filesystem"."path" AS "path"
@@ -9345,7 +9521,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.38
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.39
'''
SELECT "posthog_sharingconfiguration"."id",
"posthog_sharingconfiguration"."team_id",
@@ -9364,26 +9540,6 @@
WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.39
- '''
- SELECT "posthog_insightvariable"."id",
- "posthog_insightvariable"."name",
- "posthog_insightvariable"."code_name",
- "posthog_insightvariable"."type",
- "posthog_insightvariable"."default_value",
- "posthog_insightvariable"."is_multi"
- FROM "posthog_insightvariable"
- INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
- WHERE ("posthog_insightvariable"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_insightvariable"."team_id" = 99999))
- ORDER BY "posthog_insightvariable"."name" ASC
- '''
-# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.4
'''
SELECT "ee_accesscontrol"."id",
@@ -9408,6 +9564,26 @@
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.40
+ '''
+ SELECT "posthog_insightvariable"."id",
+ "posthog_insightvariable"."name",
+ "posthog_insightvariable"."code_name",
+ "posthog_insightvariable"."type",
+ "posthog_insightvariable"."default_value",
+ "posthog_insightvariable"."is_multi"
+ FROM "posthog_insightvariable"
+ INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
+ WHERE ("posthog_insightvariable"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_insightvariable"."team_id" = 99999))
+ ORDER BY "posthog_insightvariable"."name" ASC
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.41
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -9763,7 +9939,7 @@
ORDER BY "posthog_dashboarditem"."order" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.41
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.42
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -9772,7 +9948,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.42
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.43
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -9818,7 +9994,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.43
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.44
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -9864,7 +10040,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.44
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.45
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10003,7 +10179,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.45
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.46
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10058,7 +10234,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.46
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.47
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -10081,7 +10257,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.47
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.48
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -10134,7 +10310,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.48
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.49
'''
SELECT "ee_accesscontrol"."team_id" AS "team_id",
"ee_accesscontrol"."resource_id" AS "resource_id",
@@ -10147,18 +10323,6 @@
AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.49
- '''
- SELECT "ee_role"."organization_id" AS "role__organization_id",
- "ee_rolemembership"."role_id" AS "role_id"
- FROM "ee_rolemembership"
- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
- WHERE ("ee_rolemembership"."user_id" = 99999
- AND ("ee_rolemembership"."organization_member_id" IS NULL
- OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
- '''
-# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.5
'''
SELECT "posthog_organizationmembership"."id",
@@ -10213,6 +10377,18 @@
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.50
+ '''
+ SELECT "ee_role"."organization_id" AS "role__organization_id",
+ "ee_rolemembership"."role_id" AS "role_id"
+ FROM "ee_rolemembership"
+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_rolemembership"."organization_member_id" = "posthog_organizationmembership"."id")
+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")
+ WHERE ("ee_rolemembership"."user_id" = 99999
+ AND ("ee_rolemembership"."organization_member_id" IS NULL
+ OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.51
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -10232,7 +10408,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.51
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.52
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -10245,7 +10421,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.52
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.53
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -10258,7 +10434,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.53
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.54
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -10271,7 +10447,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.54
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.55
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -10304,7 +10480,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.55
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.56
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10403,7 +10579,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.56
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.57
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10449,7 +10625,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.57
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.58
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -10461,7 +10637,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.58
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.59
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10560,7 +10736,20 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.59
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.6
+ '''
+ SELECT "ee_accesscontrol"."team_id" AS "team_id",
+ "ee_accesscontrol"."resource_id" AS "resource_id",
+ "ee_accesscontrol"."organization_member_id" AS "organization_member_id",
+ "ee_accesscontrol"."role_id" AS "role_id",
+ "ee_accesscontrol"."access_level" AS "access_level"
+ FROM "ee_accesscontrol"
+ INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")
+ WHERE ("ee_accesscontrol"."resource" = 'project'
+ AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.60
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10606,20 +10795,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.6
- '''
- SELECT "ee_accesscontrol"."team_id" AS "team_id",
- "ee_accesscontrol"."resource_id" AS "resource_id",
- "ee_accesscontrol"."organization_member_id" AS "organization_member_id",
- "ee_accesscontrol"."role_id" AS "role_id",
- "ee_accesscontrol"."access_level" AS "access_level"
- FROM "ee_accesscontrol"
- INNER JOIN "posthog_team" ON ("ee_accesscontrol"."team_id" = "posthog_team"."id")
- WHERE ("ee_accesscontrol"."resource" = 'project'
- AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.60
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.61
'''
SELECT 1 AS "a"
FROM "posthog_sharingconfiguration"
@@ -10631,7 +10807,7 @@
LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.61
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.62
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10730,7 +10906,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.62
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.63
'''
SELECT "posthog_filesystem"."team_id",
"posthog_filesystem"."id",
@@ -10755,7 +10931,7 @@
AND "posthog_filesystem"."shortcut" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.63
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.64
'''
SELECT "posthog_insightviewed"."id",
"posthog_insightviewed"."team_id",
@@ -10773,7 +10949,7 @@
UPDATE
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.64
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.65
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -10819,7 +10995,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.65
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.66
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -10918,7 +11094,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.66
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.67
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -10945,7 +11121,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.67
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.68
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -10972,7 +11148,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.68
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.69
'''
SELECT "posthog_insightvariable"."id",
"posthog_insightvariable"."name",
@@ -10992,17 +11168,6 @@
ORDER BY "posthog_insightvariable"."name" ASC
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.69
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.7
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
@@ -11016,6 +11181,72 @@
'''
# ---
# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.70
+ '''
+ SELECT "posthog_teamrevenueanalyticsconfig"."team_id",
+ "posthog_teamrevenueanalyticsconfig"."filter_test_accounts",
+ "posthog_teamrevenueanalyticsconfig"."notified_first_sync",
+ "posthog_teamrevenueanalyticsconfig"."events",
+ "posthog_teamrevenueanalyticsconfig"."goals",
+ "posthog_teamrevenueanalyticsconfig"."base_currency"
+ FROM "posthog_teamrevenueanalyticsconfig"
+ WHERE "posthog_teamrevenueanalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.71
+ '''
+ SELECT "posthog_teammarketinganalyticsconfig"."team_id",
+ "posthog_teammarketinganalyticsconfig"."attribution_window_days",
+ "posthog_teammarketinganalyticsconfig"."attribution_mode",
+ "posthog_teammarketinganalyticsconfig"."filter_test_accounts",
+ "posthog_teammarketinganalyticsconfig"."sources_map",
+ "posthog_teammarketinganalyticsconfig"."conversion_goals",
+ "posthog_teammarketinganalyticsconfig"."campaign_name_mappings",
+ "posthog_teammarketinganalyticsconfig"."custom_source_mappings",
+ "posthog_teammarketinganalyticsconfig"."campaign_field_preferences"
+ FROM "posthog_teammarketinganalyticsconfig"
+ WHERE "posthog_teammarketinganalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.72
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."team_id",
+ "customer_analytics_teamcustomeranalyticsconfig"."activity_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_pageview_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."signup_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."subscription_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."payment_event",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index",
+ "customer_analytics_teamcustomeranalyticsconfig"."default_pinned_properties",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules",
+ "customer_analytics_teamcustomeranalyticsconfig"."account_track_rules_enabled_at"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.73
+ '''
+ SELECT "customer_analytics_teamcustomeranalyticsconfig"."account_group_type_index" AS "account_group_type_index"
+ FROM "customer_analytics_teamcustomeranalyticsconfig"
+ WHERE "customer_analytics_teamcustomeranalyticsconfig"."team_id" = 99999
+ ORDER BY "customer_analytics_teamcustomeranalyticsconfig"."team_id" ASC
+ LIMIT 1
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.74
+ '''
+ SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
+ FROM "posthog_dashboardtile"
+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
+ WHERE (NOT ("posthog_dashboardtile"."deleted"
+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)
+ AND NOT ("posthog_dashboard"."deleted")
+ AND "posthog_dashboardtile"."insight_id" = 99999)
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.75
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -11048,7 +11279,18 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.71
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.76
+ '''
+ SELECT "django_content_type"."id",
+ "django_content_type"."app_label",
+ "django_content_type"."model"
+ FROM "django_content_type"
+ WHERE ("django_content_type"."app_label" = 'product_analytics'
+ AND "django_content_type"."model" = 'insight')
+ LIMIT 21
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.77
'''
SELECT "posthog_tag"."name" AS "tag__name"
FROM "posthog_taggeditem"
@@ -11057,7 +11299,7 @@
AND "posthog_taggeditem"."object_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.72
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.78
'''
SELECT "posthog_user"."id",
"posthog_user"."password",
@@ -11103,7 +11345,7 @@
AND "posthog_user"."id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.73
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.79
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -11149,7 +11391,23 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.74
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.8
+ '''
+ SELECT COUNT(*) AS "__count"
+ FROM "posthog_dashboard"
+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
+ WHERE (NOT ("posthog_dashboard"."deleted")
+ AND ("posthog_dashboard"."team_id" =
+ (SELECT U0."parent_team_id" AS "parent_team_id"
+ FROM "posthog_team" U0
+ WHERE U0."id" = 99999
+ LIMIT 1)
+ OR ("posthog_team"."parent_team_id" IS NULL
+ AND "posthog_dashboard"."team_id" = 99999))
+ AND NOT "posthog_dashboard"."deleted")
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.80
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11288,7 +11546,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.75
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.81
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11343,7 +11601,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.76
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.82
'''
SELECT "ee_accesscontrol"."id",
"ee_accesscontrol"."team_id",
@@ -11366,7 +11624,7 @@
AND "ee_accesscontrol"."team_id" = 99999))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.77
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.83
'''
SELECT "posthog_organizationmembership"."id",
"posthog_organizationmembership"."organization_id",
@@ -11419,7 +11677,7 @@
WHERE "posthog_organizationmembership"."user_id" = 99999
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.78
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.84
'''
SELECT "ee_accesscontrol"."team_id" AS "team_id",
"ee_accesscontrol"."resource_id" AS "resource_id",
@@ -11432,7 +11690,7 @@
AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.79
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.85
'''
SELECT "ee_role"."organization_id" AS "role__organization_id",
"ee_rolemembership"."role_id" AS "role_id"
@@ -11444,23 +11702,7 @@
OR "posthog_organizationmembership"."organization_id" = ("ee_role"."organization_id")))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.8
- '''
- SELECT COUNT(*) AS "__count"
- FROM "posthog_dashboard"
- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND ("posthog_dashboard"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_dashboard"."team_id" = 99999))
- AND NOT "posthog_dashboard"."deleted")
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.80
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.86
'''
SELECT "posthog_dashboard"."id" AS "id"
FROM "posthog_dashboard"
@@ -11480,7 +11722,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.81
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.87
'''
SELECT "posthog_dashboard"."id" AS "id",
"posthog_dashboard"."name" AS "name"
@@ -11493,7 +11735,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.82
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.88
'''
SELECT COUNT(*) AS "__count"
FROM "posthog_dashboardtile"
@@ -11506,7 +11748,7 @@
AND "posthog_dashboardtile"."deleted" IS NOT NULL))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.83
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.89
'''
SELECT "posthog_dashboard"."id",
"posthog_dashboard"."name",
@@ -11539,7 +11781,7 @@
5 /* ... */))
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.84
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.9
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11638,65 +11880,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.85
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.86
- '''
- SELECT 1 AS "a"
- FROM "posthog_sharingconfiguration"
- WHERE ("posthog_sharingconfiguration"."enabled"
- AND ("posthog_sharingconfiguration"."expires_at" IS NULL
- OR "posthog_sharingconfiguration"."expires_at" > 'SHARING-EXPIRY-TIMESTAMP'::timestamptz)
- AND "posthog_sharingconfiguration"."dashboard_id" = 99999
- AND "posthog_sharingconfiguration"."team_id" = 99999)
- LIMIT 1
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.87
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.90
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11795,50 +11979,65 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.88
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.91
'''
- SELECT "posthog_filesystem"."team_id",
- "posthog_filesystem"."id",
- "posthog_filesystem"."path",
- "posthog_filesystem"."depth",
- "posthog_filesystem"."type",
- "posthog_filesystem"."ref",
- "posthog_filesystem"."href",
- "posthog_filesystem"."shortcut",
- "posthog_filesystem"."meta",
- "posthog_filesystem"."created_at",
- "posthog_filesystem"."created_by_id",
- "posthog_filesystem"."surface",
- "posthog_filesystem"."project_id"
- FROM "posthog_filesystem"
- WHERE (("posthog_filesystem"."surface" IS NULL
- OR "posthog_filesystem"."surface" = 'web')
- AND "posthog_filesystem"."ref" = '0001'
- AND "posthog_filesystem"."team_id" = 99999
- AND "posthog_filesystem"."type" = 'insight'
- AND NOT ("posthog_filesystem"."shortcut"
- AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ SELECT "posthog_organization"."id",
+ "posthog_organization"."name",
+ "posthog_organization"."slug",
+ "posthog_organization"."logo_media_id",
+ "posthog_organization"."created_at",
+ "posthog_organization"."updated_at",
+ "posthog_organization"."is_active",
+ "posthog_organization"."is_not_active_reason",
+ "posthog_organization"."session_cookie_age",
+ "posthog_organization"."is_member_join_email_enabled",
+ "posthog_organization"."is_ai_data_processing_approved",
+ "posthog_organization"."is_ai_training_opted_in",
+ "posthog_organization"."is_ai_training_locked",
+ "posthog_organization"."is_ai_training_cta_shown",
+ "posthog_organization"."enforce_2fa",
+ "posthog_organization"."enforce_verified_domains",
+ "posthog_organization"."members_can_invite",
+ "posthog_organization"."members_can_create_projects",
+ "posthog_organization"."members_can_use_personal_api_keys",
+ "posthog_organization"."members_can_see_org_members",
+ "posthog_organization"."uses_most_specific_access_resolution",
+ "posthog_organization"."allow_publicly_shared_resources",
+ "posthog_organization"."member_notice",
+ "posthog_organization"."read_only_mcp_access",
+ "posthog_organization"."default_role_id",
+ "posthog_organization"."plugins_access_level",
+ "posthog_organization"."for_internal_metrics",
+ "posthog_organization"."default_anonymize_ips",
+ "posthog_organization"."is_pending_deletion",
+ "posthog_organization"."customer_id",
+ "posthog_organization"."available_product_features",
+ "posthog_organization"."usage",
+ "posthog_organization"."never_drop_data",
+ "posthog_organization"."customer_trust_scores",
+ "posthog_organization"."has_active_subscription",
+ "posthog_organization"."setup_section_2_completed",
+ "posthog_organization"."personalization",
+ "posthog_organization"."domain_whitelist",
+ "posthog_organization"."is_platform"
+ FROM "posthog_organization"
+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
+ LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.89
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.92
'''
- SELECT "posthog_insightviewed"."id",
- "posthog_insightviewed"."team_id",
- "posthog_insightviewed"."user_id",
- "posthog_insightviewed"."insight_id",
- "posthog_insightviewed"."last_viewed_at",
- "posthog_insightviewed"."source",
- "posthog_insightviewed"."dashboard_id"
- FROM "posthog_insightviewed"
- WHERE ("posthog_insightviewed"."insight_id" = 99999
- AND "posthog_insightviewed"."team_id" = 99999
- AND "posthog_insightviewed"."user_id" = 99999)
- LIMIT 21
- FOR
- UPDATE
+ SELECT 1 AS "a"
+ FROM "posthog_sharingconfiguration"
+ WHERE ("posthog_sharingconfiguration"."enabled"
+ AND ("posthog_sharingconfiguration"."expires_at" IS NULL
+ OR "posthog_sharingconfiguration"."expires_at" > 'SHARING-EXPIRY-TIMESTAMP'::timestamptz)
+ AND "posthog_sharingconfiguration"."dashboard_id" = 99999
+ AND "posthog_sharingconfiguration"."team_id" = 99999)
+ LIMIT 1
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.9
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.93
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -11937,7 +12136,50 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.90
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.94
+ '''
+ SELECT "posthog_filesystem"."team_id",
+ "posthog_filesystem"."id",
+ "posthog_filesystem"."path",
+ "posthog_filesystem"."depth",
+ "posthog_filesystem"."type",
+ "posthog_filesystem"."ref",
+ "posthog_filesystem"."href",
+ "posthog_filesystem"."shortcut",
+ "posthog_filesystem"."meta",
+ "posthog_filesystem"."created_at",
+ "posthog_filesystem"."created_by_id",
+ "posthog_filesystem"."surface",
+ "posthog_filesystem"."project_id"
+ FROM "posthog_filesystem"
+ WHERE (("posthog_filesystem"."surface" IS NULL
+ OR "posthog_filesystem"."surface" = 'web')
+ AND "posthog_filesystem"."ref" = '0001'
+ AND "posthog_filesystem"."team_id" = 99999
+ AND "posthog_filesystem"."type" = 'insight'
+ AND NOT ("posthog_filesystem"."shortcut"
+ AND "posthog_filesystem"."shortcut" IS NOT NULL))
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.95
+ '''
+ SELECT "posthog_insightviewed"."id",
+ "posthog_insightviewed"."team_id",
+ "posthog_insightviewed"."user_id",
+ "posthog_insightviewed"."insight_id",
+ "posthog_insightviewed"."last_viewed_at",
+ "posthog_insightviewed"."source",
+ "posthog_insightviewed"."dashboard_id"
+ FROM "posthog_insightviewed"
+ WHERE ("posthog_insightviewed"."insight_id" = 99999
+ AND "posthog_insightviewed"."team_id" = 99999
+ AND "posthog_insightviewed"."user_id" = 99999)
+ LIMIT 21
+ FOR
+ UPDATE
+ '''
+# ---
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.96
'''
SELECT "posthog_organization"."id",
"posthog_organization"."name",
@@ -11983,7 +12225,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.91
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.97
'''
SELECT "posthog_team"."id",
"posthog_team"."uuid",
@@ -12082,7 +12324,7 @@
LIMIT 21
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.92
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.98
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12109,7 +12351,7 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.93
+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.99
'''
SELECT "posthog_dashboardtile"."id",
"posthog_dashboardtile"."dashboard_id",
@@ -12136,171 +12378,6 @@
AND "posthog_dashboardtile"."insight_id" = 99999)
'''
# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.94
- '''
- SELECT "posthog_insightvariable"."id",
- "posthog_insightvariable"."name",
- "posthog_insightvariable"."code_name",
- "posthog_insightvariable"."type",
- "posthog_insightvariable"."default_value",
- "posthog_insightvariable"."is_multi"
- FROM "posthog_insightvariable"
- INNER JOIN "posthog_team" ON ("posthog_insightvariable"."team_id" = "posthog_team"."id")
- WHERE ("posthog_insightvariable"."team_id" =
- (SELECT U0."parent_team_id" AS "parent_team_id"
- FROM "posthog_team" U0
- WHERE U0."id" = 99999
- LIMIT 1)
- OR ("posthog_team"."parent_team_id" IS NULL
- AND "posthog_insightvariable"."team_id" = 99999))
- ORDER BY "posthog_insightvariable"."name" ASC
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.95
- '''
- SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"
- FROM "posthog_dashboardtile"
- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")
- WHERE (NOT ("posthog_dashboardtile"."deleted"
- AND "posthog_dashboardtile"."deleted" IS NOT NULL)
- AND NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboardtile"."insight_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.96
- '''
- SELECT "posthog_dashboard"."id",
- "posthog_dashboard"."name",
- "posthog_dashboard"."description",
- "posthog_dashboard"."team_id",
- "posthog_dashboard"."pinned",
- "posthog_dashboard"."created_at",
- "posthog_dashboard"."created_by_id",
- "posthog_dashboard"."deleted",
- "posthog_dashboard"."last_accessed_at",
- "posthog_dashboard"."last_refresh",
- "posthog_dashboard"."filters",
- "posthog_dashboard"."variables",
- "posthog_dashboard"."breakdown_colors",
- "posthog_dashboard"."data_color_theme_id",
- "posthog_dashboard"."creation_mode",
- "posthog_dashboard"."restriction_level",
- "posthog_dashboard"."quick_filter_ids",
- "posthog_dashboard"."customization",
- "posthog_dashboard"."deprecated_tags",
- "posthog_dashboard"."tags",
- "posthog_dashboard"."share_token",
- "posthog_dashboard"."is_shared"
- FROM "posthog_dashboard"
- WHERE (NOT ("posthog_dashboard"."deleted")
- AND "posthog_dashboard"."id" IN (1,
- 2,
- 3,
- 4,
- 5 /* ... */))
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.97
- '''
- SELECT "posthog_tag"."name" AS "tag__name"
- FROM "posthog_taggeditem"
- INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")
- WHERE ("posthog_taggeditem"."content_type_id" = 99999
- AND "posthog_taggeditem"."object_id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.98
- '''
- SELECT "posthog_user"."id",
- "posthog_user"."password",
- "posthog_user"."last_login",
- "posthog_user"."first_name",
- "posthog_user"."last_name",
- "posthog_user"."is_staff",
- "posthog_user"."date_joined",
- "posthog_user"."uuid",
- "posthog_user"."current_organization_id",
- "posthog_user"."current_team_id",
- "posthog_user"."email",
- "posthog_user"."pending_email",
- "posthog_user"."distinct_id",
- "posthog_user"."is_email_verified",
- "posthog_user"."credentials_reviewed_at",
- "posthog_user"."requested_2fa_reset_at",
- "posthog_user"."has_seen_product_intro_for",
- "posthog_user"."strapi_id",
- "posthog_user"."is_active",
- "posthog_user"."role_at_organization",
- "posthog_user"."theme_mode",
- "posthog_user"."partial_notification_settings",
- "posthog_user"."anonymize_data",
- "posthog_user"."allow_impersonation",
- "posthog_user"."toolbar_mode",
- "posthog_user"."hedgehog_config",
- "posthog_user"."allow_sidebar_suggestions",
- "posthog_user"."shortcut_position",
- "posthog_user"."passkeys_enabled_for_2fa",
- "posthog_user"."hide_mcp_hints",
- "posthog_user"."ui_configuration",
- "posthog_user"."onboarding_skipped_at",
- "posthog_user"."onboarding_skipped_reason",
- "posthog_user"."onboarding_skipped_organization_id",
- "posthog_user"."onboarding_delegated_to_invite_id",
- "posthog_user"."onboarding_delegated_to_organization_id",
- "posthog_user"."onboarding_delegation_accepted_at",
- "posthog_user"."events_column_config",
- "posthog_user"."email_opt_in"
- FROM "posthog_user"
- WHERE ("posthog_user"."is_active"
- AND "posthog_user"."id" = 99999)
- '''
-# ---
-# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.99
- '''
- SELECT "posthog_organization"."id",
- "posthog_organization"."name",
- "posthog_organization"."slug",
- "posthog_organization"."logo_media_id",
- "posthog_organization"."created_at",
- "posthog_organization"."updated_at",
- "posthog_organization"."is_active",
- "posthog_organization"."is_not_active_reason",
- "posthog_organization"."session_cookie_age",
- "posthog_organization"."is_member_join_email_enabled",
- "posthog_organization"."is_ai_data_processing_approved",
- "posthog_organization"."is_ai_training_opted_in",
- "posthog_organization"."is_ai_training_locked",
- "posthog_organization"."is_ai_training_cta_shown",
- "posthog_organization"."enforce_2fa",
- "posthog_organization"."enforce_verified_domains",
- "posthog_organization"."members_can_invite",
- "posthog_organization"."members_can_create_projects",
- "posthog_organization"."members_can_use_personal_api_keys",
- "posthog_organization"."members_can_see_org_members",
- "posthog_organization"."uses_most_specific_access_resolution",
- "posthog_organization"."allow_publicly_shared_resources",
- "posthog_organization"."member_notice",
- "posthog_organization"."read_only_mcp_access",
- "posthog_organization"."default_role_id",
- "posthog_organization"."plugins_access_level",
- "posthog_organization"."for_internal_metrics",
- "posthog_organization"."default_anonymize_ips",
- "posthog_organization"."is_pending_deletion",
- "posthog_organization"."customer_id",
- "posthog_organization"."available_product_features",
- "posthog_organization"."usage",
- "posthog_organization"."never_drop_data",
- "posthog_organization"."customer_trust_scores",
- "posthog_organization"."has_active_subscription",
- "posthog_organization"."setup_section_2_completed",
- "posthog_organization"."personalization",
- "posthog_organization"."domain_whitelist",
- "posthog_organization"."is_platform"
- FROM "posthog_organization"
- WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid
- LIMIT 21
- '''
-# ---
# name: TestDashboard.test_retrieve_dashboard
'''
SELECT "posthog_filesystem"."team_id",
diff --git a/posthog/hogql/property.py b/posthog/hogql/property.py
index 294664e803b7..16ddc97984f1 100644
--- a/posthog/hogql/property.py
+++ b/posthog/hogql/property.py
@@ -1223,6 +1223,7 @@ def property_to_expr(
"event", "person", "group", "session", "replay", "replay_entity", "revenue_analytics", "log_resource"
] = "event",
strict: bool = False,
+ cohort_via_distinct_id: bool = False,
) -> ast.Expr:
if isinstance(property, dict):
is_behavioral = property.get("type") == "behavioral"
@@ -1238,7 +1239,10 @@ def property_to_expr(
raise QueryError(f"Invalid behavioral property filter: {e}")
return ast.Constant(value=1)
elif isinstance(property, list):
- properties = [property_to_expr(p, team, scope, strict=strict) for p in property]
+ properties = [
+ property_to_expr(p, team, scope, strict=strict, cohort_via_distinct_id=cohort_via_distinct_id)
+ for p in property
+ ]
if len(properties) == 0:
return ast.Constant(value=1)
if len(properties) == 1:
@@ -1269,12 +1273,24 @@ def property_to_expr(
if len(property.values) == 0:
return ast.Constant(value=1)
if len(property.values) == 1:
- return property_to_expr(property.values[0], team, scope, strict=strict)
+ return property_to_expr(
+ property.values[0], team, scope, strict=strict, cohort_via_distinct_id=cohort_via_distinct_id
+ )
if property.type == PropertyOperatorType.AND or property.type == FilterLogicalOperator.AND_:
- return ast.And(exprs=[property_to_expr(p, team, scope, strict=strict) for p in property.values])
+ return ast.And(
+ exprs=[
+ property_to_expr(p, team, scope, strict=strict, cohort_via_distinct_id=cohort_via_distinct_id)
+ for p in property.values
+ ]
+ )
else:
- return ast.Or(exprs=[property_to_expr(p, team, scope, strict=strict) for p in property.values])
+ return ast.Or(
+ exprs=[
+ property_to_expr(p, team, scope, strict=strict, cohort_via_distinct_id=cohort_via_distinct_id)
+ for p in property.values
+ ]
+ )
elif isinstance(property, EmptyPropertyFilter):
return ast.Constant(value=1)
elif isinstance(property, FlagPropertyFilter):
@@ -1696,14 +1712,30 @@ def property_to_expr(
# The id comes from the request, so a deleted or foreign cohort must read as
# bad input rather than escaping as an unhandled DoesNotExist.
raise QueryError(f"Cohort {property.value} does not exist")
+ # Kludge: negation is outdated but still used in places
+ negated = property.negation or property.operator == PropertyOperator.NOT_IN.value
+
+ if cohort_via_distinct_id:
+ # `person_id` on a warehouse table can be an alias of the configured `distinct_id_field`,
+ # which holds arbitrary strings. Cohort membership is defined over person UUIDs, so
+ # comparing the two makes ClickHouse parse those strings as UUIDs and fail the query.
+ return ast.CompareOperation(
+ left=ast.Field(chain=["distinct_id"]),
+ op=(ast.CompareOperationOp.NotIn if negated else ast.CompareOperationOp.In),
+ right=ast.SelectQuery(
+ select=[ast.Field(chain=["distinct_id"])],
+ select_from=ast.JoinExpr(table=ast.Field(chain=["person_distinct_ids"])),
+ where=ast.CompareOperation(
+ left=ast.Field(chain=["person_id"]),
+ op=ast.CompareOperationOp.InCohort,
+ right=ast.Constant(value=cohort.pk),
+ ),
+ ),
+ )
+
return ast.CompareOperation(
left=ast.Field(chain=["id" if scope == "person" else "person_id"]),
- op=(
- ast.CompareOperationOp.NotInCohort
- # Kludge: negation is outdated but still used in places
- if property.negation or property.operator == PropertyOperator.NOT_IN.value
- else ast.CompareOperationOp.InCohort
- ),
+ op=(ast.CompareOperationOp.NotInCohort if negated else ast.CompareOperationOp.InCohort),
right=ast.Constant(value=cohort.pk),
)
diff --git a/posthog/hogql/test/test_property.py b/posthog/hogql/test/test_property.py
index b7545688b68c..f46868fe5809 100644
--- a/posthog/hogql/test/test_property.py
+++ b/posthog/hogql/test/test_property.py
@@ -111,9 +111,16 @@ class TestProperty(BaseTest):
Literal["event", "person", "group", "session", "replay", "replay_entity", "revenue_analytics"]
] = None,
strict: bool = True,
+ cohort_via_distinct_id: bool = False,
):
return clear_locations(
- property_to_expr(property, team=team or self.team, scope=scope or "event", strict=strict)
+ property_to_expr(
+ property,
+ team=team or self.team,
+ scope=scope or "event",
+ strict=strict,
+ cohort_via_distinct_id=cohort_via_distinct_id,
+ )
)
def _selector_to_expr(self, selector: str):
@@ -1069,6 +1076,30 @@ class TestProperty(BaseTest):
self._parse_expr(f"person_id IN COHORT {cohort.pk}"),
)
+ @parameterized.expand(
+ [
+ ("in", {}, "IN"),
+ ("negation", {"negation": True}, "NOT IN"),
+ ("not_in_operator", {"operator": "not_in"}, "NOT IN"),
+ ]
+ )
+ def test_cohort_filter_via_distinct_id(self, _name: str, extra: dict, expected_op: str):
+ cohort = Cohort.objects.create(
+ team=self.team,
+ groups=[{"properties": [{"key": "$os", "value": "Chrome", "type": "person"}]}],
+ )
+ self.assertEqual(
+ self._property_to_expr(
+ {"type": "cohort", "key": "id", "value": cohort.pk, **extra},
+ self.team,
+ cohort_via_distinct_id=True,
+ ),
+ self._parse_expr(
+ f"distinct_id {expected_op} "
+ f"(SELECT distinct_id FROM person_distinct_ids WHERE person_id IN COHORT {cohort.pk})"
+ ),
+ )
+
def test_cohort_filter_missing_cohort(self):
with self.assertRaisesMessage(QueryError, "Cohort 2137 does not exist"):
self._property_to_expr({"type": "cohort", "key": "id", "value": 2137}, self.team)
diff --git a/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py b/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py
index f984b407adc0..86066b27da19 100644
--- a/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py
+++ b/products/product_analytics/backend/hogql_queries/stickiness/stickiness_query_runner.py
@@ -438,6 +438,8 @@ class StickinessQueryRunner(AnalyticsQueryRunner[StickinessQueryResponse]):
# If an action doesn't exist, we want to return no events
filters.append(parse_expr("1 = 2"))
+ cohort_via_distinct_id = isinstance(series, DataWarehouseNode)
+
# Filter Test Accounts
if (
self.query.filterTestAccounts
@@ -445,15 +447,19 @@ class StickinessQueryRunner(AnalyticsQueryRunner[StickinessQueryResponse]):
and len(self.team.test_account_filters) > 0
):
for property in self.team.test_account_filters:
- filters.append(property_to_expr(property, self.team))
+ filters.append(property_to_expr(property, self.team, cohort_via_distinct_id=cohort_via_distinct_id))
# Properties
if self.query.properties is not None and self.query.properties != []:
- filters.append(property_to_expr(self.query.properties, self.team))
+ filters.append(
+ property_to_expr(self.query.properties, self.team, cohort_via_distinct_id=cohort_via_distinct_id)
+ )
# Series Filters
if series.properties is not None and series.properties != []:
- filters.append(property_to_expr(series.properties, self.team))
+ filters.append(
+ property_to_expr(series.properties, self.team, cohort_via_distinct_id=cohort_via_distinct_id)
+ )
# Ignore empty groups
if series.math == "unique_group" and series.math_group_type_index is not None:
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr
index 1eb6eec70c96..1138d0d188a8 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr
+++ b/products/product_analytics/backend/hogql_queries/trends/test/__snapshots__/test_trends_data_warehouse_query.ambr
@@ -324,38 +324,6 @@
use_hive_partitioning=0
'''
# ---
-# name: TestTrendsDataWarehouseQuery.test_trends_entity_property
- '''
- SELECT arrayMap(number -> plus(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(number)), range(0, plus(coalesce(dateDiff('day', toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), toStartOfInterval(assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC')), toIntervalDay(1)))), 1))) AS date,
- arrayMap(_match_date -> arraySum(arraySlice(groupArray(ifNull(count, 0)), indexOf(groupArray(day_start) AS _days_for_count, _match_date) AS _index, plus(minus(arrayLastIndex(x -> ifNull(equals(x, _match_date), isNull(x)
- and isNull(_match_date)), _days_for_count), _index), 1))), date) AS total
- FROM
- (SELECT sum(total) AS count,
- day_start AS day_start
- FROM
- (SELECT count() AS total,
- toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
- FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
- WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
- GROUP BY day_start)
- GROUP BY day_start
- ORDER BY day_start ASC)
- ORDER BY arraySum(total) DESC
- LIMIT 100 SETTINGS format_csv_allow_double_quotes=1,
- readonly=2,
- max_execution_time=60,
- allow_experimental_object_type=1,
- max_ast_elements=4000000,
- max_expanded_ast_elements=4000000,
- max_bytes_before_external_group_by=0,
- transform_null_in=1,
- optimize_min_equality_disjunction_chain_length=4294967295,
- optimize_rewrite_aggregate_function_with_if=0,
- optimize_min_inequality_conjunction_chain_length=4294967295,
- allow_experimental_join_condition=1,
- use_hive_partitioning=0
- '''
-# ---
# name: TestTrendsDataWarehouseQuery.test_trends_events_and_data_warehouse_all_time
'''
SELECT min(toTimeZone(posthog_test_test_table_1.created, 'UTC')) AS `min(toTimeZone(created, 'UTC'))`
@@ -514,7 +482,39 @@
use_hive_partitioning=0
'''
# ---
-# name: TestTrendsDataWarehouseQuery.test_trends_query_properties
+# name: TestTrendsDataWarehouseQuery.test_trends_property_filter_0_series
+ '''
+ SELECT arrayMap(number -> plus(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(number)), range(0, plus(coalesce(dateDiff('day', toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), toStartOfInterval(assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC')), toIntervalDay(1)))), 1))) AS date,
+ arrayMap(_match_date -> arraySum(arraySlice(groupArray(ifNull(count, 0)), indexOf(groupArray(day_start) AS _days_for_count, _match_date) AS _index, plus(minus(arrayLastIndex(x -> ifNull(equals(x, _match_date), isNull(x)
+ and isNull(_match_date)), _days_for_count), _index), 1))), date) AS total
+ FROM
+ (SELECT sum(total) AS count,
+ day_start AS day_start
+ FROM
+ (SELECT count() AS total,
+ toStartOfDay(toTimeZone(e.created, 'UTC')) AS day_start
+ FROM s3('http://host.docker.internal:19000/posthog/test_storage_bucket-posthog.hogql.datawarehouse.trendquery/posthog_test_test_table_1/*.csv', 'object_storage_root_user', 'object_storage_root_password', 'CSVWithNames', '`id` String, `prop_1` String, `prop_2` String, `created` DateTime64(3, \'UTC\')') AS e
+ WHERE and(greaterOrEquals(toTimeZone(e.created, 'UTC'), toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1))), lessOrEquals(toTimeZone(e.created, 'UTC'), assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC'))), equals(e.prop_1, 'a'))
+ GROUP BY day_start)
+ GROUP BY day_start
+ ORDER BY day_start ASC)
+ ORDER BY arraySum(total) DESC
+ LIMIT 100 SETTINGS format_csv_allow_double_quotes=1,
+ readonly=2,
+ max_execution_time=60,
+ allow_experimental_object_type=1,
+ max_ast_elements=4000000,
+ max_expanded_ast_elements=4000000,
+ max_bytes_before_external_group_by=0,
+ transform_null_in=1,
+ optimize_min_equality_disjunction_chain_length=4294967295,
+ optimize_rewrite_aggregate_function_with_if=0,
+ optimize_min_inequality_conjunction_chain_length=4294967295,
+ allow_experimental_join_condition=1,
+ use_hive_partitioning=0
+ '''
+# ---
+# name: TestTrendsDataWarehouseQuery.test_trends_property_filter_1_query
'''
SELECT arrayMap(number -> plus(toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), toIntervalDay(number)), range(0, plus(coalesce(dateDiff('day', toStartOfInterval(assumeNotNull(toDateTime('2023-01-01 00:00:00', 'UTC')), toIntervalDay(1)), toStartOfInterval(assumeNotNull(toDateTime('2023-01-07 23:59:59', 'UTC')), toIntervalDay(1)))), 1))) AS date,
arrayMap(_match_date -> arraySum(arraySlice(groupArray(ifNull(count, 0)), indexOf(groupArray(day_start) AS _days_for_count, _match_date) AS _index, plus(minus(arrayLastIndex(x -> ifNull(equals(x, _match_date), isNull(x)
diff --git a/products/product_analytics/backend/hogql_queries/trends/test/test_trends_data_warehouse_query.py b/products/product_analytics/backend/hogql_queries/trends/test/test_trends_data_warehouse_query.py
index 1067da477802..cc9cf2bdcd77 100644
--- a/products/product_analytics/backend/hogql_queries/trends/test/test_trends_data_warehouse_query.py
+++ b/products/product_analytics/backend/hogql_queries/trends/test/test_trends_data_warehouse_query.py
@@ -43,6 +43,7 @@ from posthog.clickhouse.query_tagging import get_query_tags
from posthog.hogql_queries.utils.query_date_range import QueryDateRange
from posthog.models.instance_setting import override_instance_config
+from products.cohorts.backend.models.cohort import Cohort
from products.data_tools.backend.models.join import DataWarehouseJoin
from products.product_analytics.backend.hogql_queries.trends.trends_query_builder import TrendsQueryBuilder
from products.product_analytics.backend.hogql_queries.trends.trends_query_runner import TrendsQueryRunner
@@ -241,13 +242,16 @@ class TestTrendsDataWarehouseQuery(ClickhouseTestMixin, BaseTest):
assert set(response.columns).issubset({"date", "total"})
assert response.results[0][1] == [1, 1, 1, 1, 0, 0, 0]
+ @parameterized.expand(["series", "query"])
@snapshot_clickhouse_queries
- def test_trends_entity_property(self):
+ def test_trends_property_filter(self, placement: str):
table_name = self.setup_data_warehouse()
+ property_filter = DataWarehousePropertyFilter(key="prop_1", value="a", operator=PropertyOperator.EXACT)
trends_query = TrendsQuery(
kind="TrendsQuery",
dateRange=DateRange(date_from="2023-01-01"),
+ properties=[property_filter] if placement == "query" else [],
series=[
DataWarehouseNode(
id=table_name,
@@ -255,7 +259,7 @@ class TestTrendsDataWarehouseQuery(ClickhouseTestMixin, BaseTest):
id_field="id",
timestamp_field="created",
distinct_id_field="customer_email",
- properties=[DataWarehousePropertyFilter(key="prop_1", value="a", operator=PropertyOperator.EXACT)],
+ properties=[property_filter] if placement == "series" else [],
)
],
)
@@ -267,6 +271,54 @@ class TestTrendsDataWarehouseQuery(ClickhouseTestMixin, BaseTest):
assert set(response.columns).issubset({"date", "total"})
assert response.results[0][1] == [1, 0, 0, 0, 0, 0, 0]
+ @parameterized.expand(
+ [
+ ("series", [0, 1, 0, 0, 0, 0, 0]),
+ ("query", [0, 1, 0, 0, 0, 0, 0]),
+ ("test_accounts", [1, 0, 1, 1, 0, 0, 0]),
+ ]
+ )
+ def test_trends_cohort_property_matches_through_distinct_id(self, placement: str, expected: list[int]):
+ table_name = self.setup_data_warehouse()
+
+ # `id` holds "1".."4", which ClickHouse cannot parse as the person UUIDs a cohort holds.
+ # Only the person on distinct ID "2" is a member, which is the 2023-01-02 row.
+ _create_person(team_id=self.team.pk, distinct_ids=["2"], properties={"$os": "Chrome"})
+ flush_persons_and_events()
+ cohort = Cohort.objects.create(
+ team=self.team,
+ groups=[{"properties": [{"key": "$os", "value": "Chrome", "type": "person"}]}],
+ )
+ cohort.calculate_people_ch(pending_version=0)
+ cohort_filter = {"type": "cohort", "key": "id", "value": cohort.pk}
+
+ if placement == "test_accounts":
+ # A cohort exclusion is what every new team gets, so warehouse insights meet this path first.
+ self.team.test_account_filters = [{**cohort_filter, "operator": "not_in"}]
+ self.team.save()
+
+ trends_query = TrendsQuery(
+ kind="TrendsQuery",
+ dateRange=DateRange(date_from="2023-01-01"),
+ filterTestAccounts=placement == "test_accounts",
+ properties=[cohort_filter] if placement == "query" else [],
+ series=[
+ DataWarehouseNode(
+ id=table_name,
+ table_name=table_name,
+ id_field="id",
+ timestamp_field="created",
+ distinct_id_field="id",
+ properties=[cohort_filter] if placement == "series" else [],
+ )
+ ],
+ )
+
+ with time_machine.travel("2023-01-07", tick=False):
+ response = self.get_response(trends_query=trends_query)
+
+ assert response.results[0][1] == expected
+
def _avg_view_setup(self, function_name: str):
from products.data_modeling.backend.facade.models import DataWarehouseSavedQuery
@@ -332,32 +384,6 @@ class TestTrendsDataWarehouseQuery(ClickhouseTestMixin, BaseTest):
def test_trends_view_quartile(self):
assert 4 < self._avg_view_setup("p99") < 5
- @snapshot_clickhouse_queries
- def test_trends_query_properties(self):
- table_name = self.setup_data_warehouse()
-
- trends_query = TrendsQuery(
- kind="TrendsQuery",
- dateRange=DateRange(date_from="2023-01-01"),
- series=[
- DataWarehouseNode(
- id=table_name,
- table_name=table_name,
- id_field="id",
- distinct_id_field="customer_email",
- timestamp_field="created",
- )
- ],
- properties=[DataWarehousePropertyFilter(key="prop_1", value="a", operator=PropertyOperator.EXACT)],
- )
-
- with time_machine.travel("2023-01-07", tick=False):
- response = self.get_response(trends_query=trends_query)
-
- assert response.columns is not None
- assert set(response.columns).issubset({"date", "total"})
- assert response.results[0][1] == [1, 0, 0, 0, 0, 0, 0]
-
@snapshot_clickhouse_queries
def test_trends_breakdown(self):
table_name = self.setup_data_warehouse()
diff --git a/products/product_analytics/backend/hogql_queries/trends/trends_query_builder.py b/products/product_analytics/backend/hogql_queries/trends/trends_query_builder.py
index 188527375ad8..89850c907814 100644
--- a/products/product_analytics/backend/hogql_queries/trends/trends_query_builder.py
+++ b/products/product_analytics/backend/hogql_queries/trends/trends_query_builder.py
@@ -836,7 +836,9 @@ class TrendsQueryBuilder(DataWarehouseInsightQueryMixin):
and len(self.team.test_account_filters) > 0
):
for property in self.team.test_account_filters:
- filters.append(property_to_expr(property, self.team))
+ filters.append(
+ property_to_expr(property, self.team, cohort_via_distinct_id=isinstance(series, DataWarehouseNode))
+ )
# Properties
if self.query.properties is not None and self.query.properties != []:
@@ -876,6 +878,7 @@ class TrendsQueryBuilder(DataWarehouseInsightQueryMixin):
modifiers=self.modifiers,
date_range=self.query_date_range,
timings=self.timings,
+ cohort_via_distinct_id=isinstance(self.series, DataWarehouseNode),
)
def _event_or_action_where_expr(self) -> ast.Expr | None:
diff --git a/products/web_analytics/backend/hogql_queries/first_pageview_attribution.py b/products/web_analytics/backend/hogql_queries/first_pageview_attribution.py
index 5715fce8d871..85ae4fc384ca 100644
--- a/products/web_analytics/backend/hogql_queries/first_pageview_attribution.py
+++ b/products/web_analytics/backend/hogql_queries/first_pageview_attribution.py
@@ -267,6 +267,7 @@ def first_pageview_aware_properties_to_expr(
modifiers: Optional[HogQLQueryModifiers],
date_range: "QueryDateRange",
timings: Optional[HogQLTimings] = None,
+ cohort_via_distinct_id: bool = False,
) -> ast.Expr:
"""`property_to_expr`, with session-entry attribution filters rewritten.
@@ -281,7 +282,7 @@ def first_pageview_aware_properties_to_expr(
"""
rewritable = rewritable_session_filters(properties)
if not (modifiers and modifiers.webAnalyticsFirstPageviewFilters) or not rewritable:
- return property_to_expr(properties, team)
+ return property_to_expr(properties, team, cohort_via_distinct_id=cohort_via_distinct_id)
inside_periods = parse_expr(
"timestamp >= {date_from} AND timestamp <= {date_to}",
@@ -303,4 +304,5 @@ def first_pageview_aware_properties_to_expr(
),
],
team,
+ cohort_via_distinct_id=cohort_via_distinct_id,
)