: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(insights): require a query when writing an insight (#93110)
Thomas Obermüllera2b702d25206
diff --git a/ee/api/test/test_insight.py b/ee/api/test/test_insight.pyindex 24152cb430ee..586553bc18c3 100644--- a/ee/api/test/test_insight.py+++ b/ee/api/test/test_insight.py@@ -47,16 +47,7 @@ class TestInsightEnterpriseAPI(APILicensedTest):@override_settings(IN_UNIT_TESTING=True)def test_can_add_and_remove_tags(self) -> None:with freeze_time("2012-01-14T03:21:34.000Z"):- insight_id, response_data = self.dashboard_api.create_insight(- {- "name": "a created dashboard",- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- }- )+ insight_id, response_data = self.dashboard_api.create_insight({"name": "a created dashboard"})insight_short_id = response_data["short_id"]self.assertEqual(response_data["tags"], [])@@ -330,20 +321,12 @@ class TestInsightEnterpriseAPI(APILicensedTest):self.assertListEqual(sorted(response.json()["tags"]), ["a", "b"])def test_searching_insights_includes_tags_and_description(self) -> None:- insight_one_id, _ = self.dashboard_api.create_insight(- {- "name": "needle in a haystack",- "filters": {"events": [{"id": "$pageview"}]},- }- )- insight_two_id, _ = self.dashboard_api.create_insight(- {"name": "not matching", "filters": {"events": [{"id": "$pageview"}]}}- )+ insight_one_id, _ = self.dashboard_api.create_insight({"name": "needle in a haystack"})+ insight_two_id, _ = self.dashboard_api.create_insight({"name": "not matching"})insight_three_id, _ = self.dashboard_api.create_insight({"name": "not matching name",- "filters": {"events": [{"id": "$pageview"}]},"tags": ["needle"],})@@ -352,7 +335,6 @@ class TestInsightEnterpriseAPI(APILicensedTest):{"name": "not matching name","description": "another needle",- "filters": {"events": [{"id": "$pageview"}]},"tags": ["not matching"],})@@ -606,7 +588,6 @@ class TestInsightEnterpriseAPI(APILicensedTest):data={"short_id": f"insight{i}","dashboards": [dashboard.pk],- "filters": {"events": [{"id": "$pageview"}]},})diff --git a/posthog/api/test/dashboards/__init__.py b/posthog/api/test/dashboards/__init__.pyindex d102e0671b36..b7a9aef3a9aa 100644--- a/posthog/api/test/dashboards/__init__.py+++ b/posthog/api/test/dashboards/__init__.py@@ -3,6 +3,7 @@ from typing import Any, Literal, Optionalfrom rest_framework import statusfrom posthog.models.team import Team+from posthog.test.insight_queries import default_pageview_queryfrom products.dashboards.backend.widget_registry import DashboardWidgetType@@ -149,8 +150,9 @@ class DashboardAPI:if team_id is None:team_id = self.team.id- if "filters" not in data and "query" not in data:- data["filters"] = {"events": [{"id": "$pageview"}]}+ # Writing an insight needs a query, so a test with nothing to say about the definition+ # still gets one.+ data.setdefault("query", default_pageview_query())response = self.client.post(f"/api/projects/{team_id}/insights",diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambrindex 350d3c718c94..8b48cbaa5cb9 100644--- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr+++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr@@ -240,6 +240,166 @@'''# ---# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.13+ '''+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_adding_insights_is_not_nplus1_for_gets.14+ '''+ 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_adding_insights_is_not_nplus1_for_gets.15+ '''+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.16'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -264,7 +424,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.14+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.17'''SELECT "posthog_insightviewed"."id","posthog_insightviewed"."team_id",@@ -280,7 +440,7 @@UPDATE'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.15+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.18'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -307,7 +467,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.16+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.19'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -334,70 +494,6 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.17- '''- 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_adding_insights_is_not_nplus1_for_gets.18- '''- 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_adding_insights_is_not_nplus1_for_gets.19- '''- 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_adding_insights_is_not_nplus1_for_gets.2'''SELECT "posthog_team"."id",@@ -542,26 +638,90 @@# ---# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.20'''- 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"."insight_id" = 99999+ 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_adding_insights_is_not_nplus1_for_gets.21'''- 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",+ 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_adding_insights_is_not_nplus1_for_gets.22+ '''+ 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_adding_insights_is_not_nplus1_for_gets.23+ '''+ 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"."insight_id" = 99999+ '''+# ---+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.24+ '''+ 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",@@ -594,7 +754,7 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.22+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.25'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -640,7 +800,7 @@LIMIT 21'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.23+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.26'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -782,7 +942,7 @@LIMIT 21'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.24+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.27'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -837,7 +997,7 @@LIMIT 21'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.25+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.28'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -860,7 +1020,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.26+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.29'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -913,7 +1073,62 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.27+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.3+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.30'''SELECT "ee_accesscontrol"."team_id" AS "team_id","ee_accesscontrol"."resource_id" AS "resource_id",@@ -926,7 +1141,7 @@AND "posthog_team"."organization_id" IN ('00000000-0000-0000-0000-000000000000'::uuid))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.28+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.31'''SELECT "ee_role"."organization_id" AS "role__organization_id","ee_rolemembership"."role_id" AS "role_id"@@ -935,7 +1150,7 @@WHERE "ee_rolemembership"."user_id" = 99999'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.29+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.32'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -1038,62 +1253,7 @@LIMIT 21'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.3- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.30+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.33'''SELECT "posthog_sharingconfiguration"."id","posthog_sharingconfiguration"."team_id",@@ -1116,7 +1276,7 @@5 /* ... */)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.31+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.34'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -1479,7 +1639,7 @@ORDER BY "posthog_dashboarditem"."order" ASC'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.32+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.35'''SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id","posthog_dashboard"."id",@@ -1521,7 +1681,7 @@5 /* ... */))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.33+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.36'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -1552,7 +1712,7 @@5 /* ... */))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.34+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.37'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -1581,7 +1741,7 @@2)/* ... */)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.35+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.38'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -1609,7 +1769,7 @@5 /* ... */)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.36+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.39'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1711,7 +1871,30 @@LIMIT 21'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.37+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.4+ '''+ SELECT "ee_accesscontrol"."id",+ "ee_accesscontrol"."team_id",+ "ee_accesscontrol"."access_level",+ "ee_accesscontrol"."resource",+ "ee_accesscontrol"."resource_id",+ "ee_accesscontrol"."organization_member_id",+ "ee_accesscontrol"."role_id",+ "ee_accesscontrol"."created_by_id",+ "ee_accesscontrol"."created_at",+ "ee_accesscontrol"."updated_at"+ FROM "ee_accesscontrol"+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))+ '''+# ---+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.40'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -1736,7 +1919,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.38+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.41'''SELECT "posthog_filesystemshortcut"."id","posthog_filesystemshortcut"."team_id",@@ -1759,7 +1942,7 @@AND "posthog_filesystemshortcut"."href" IS NOT NULL))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.39+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.42'''SELECT "posthog_insightvariable"."id","posthog_insightvariable"."name",@@ -1779,30 +1962,7 @@ORDER BY "posthog_insightvariable"."name" ASC'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.4- '''- SELECT "ee_accesscontrol"."id",- "ee_accesscontrol"."team_id",- "ee_accesscontrol"."access_level",- "ee_accesscontrol"."resource",- "ee_accesscontrol"."resource_id",- "ee_accesscontrol"."organization_member_id",- "ee_accesscontrol"."role_id",- "ee_accesscontrol"."created_by_id",- "ee_accesscontrol"."created_at",- "ee_accesscontrol"."updated_at"- FROM "ee_accesscontrol"- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))- '''-# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.40+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.43'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -2166,7 +2326,7 @@ORDER BY "posthog_dashboarditem"."order" ASC'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.41+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.44'''SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id","posthog_dashboard"."id",@@ -2208,7 +2368,7 @@5 /* ... */))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.42+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.45'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -2239,7 +2399,7 @@5 /* ... */))'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.43+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.46'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -2268,7 +2428,7 @@2)/* ... */)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.44+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.47'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -2296,7 +2456,7 @@5 /* ... */)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.45+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.48'''SELECT "posthog_alertconfiguration"."created_by_id","posthog_alertconfiguration"."created_at",@@ -2377,7 +2537,7 @@5 /* ... */)'''# ----# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.46+# name: TestDashboard.test_adding_insights_is_not_nplus1_for_gets.49'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -2713,6 +2873,154 @@'''# ---# name: TestDashboard.test_listing_dashboards_is_not_nplus1.11+ '''+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_listing_dashboards_is_not_nplus1.12+ '''+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.13'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -2737,7 +3045,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.12+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.14'''SELECT "posthog_insightviewed"."id","posthog_insightviewed"."team_id",@@ -2753,7 +3061,7 @@UPDATE'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.13+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.15'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -2799,7 +3107,7 @@LIMIT 21'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.14+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.16'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -2901,7 +3209,7 @@LIMIT 21'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.15+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.17'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -2928,7 +3236,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.16+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.18'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -2955,7 +3263,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.17+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.19'''SELECT "posthog_insightvariable"."id","posthog_insightvariable"."name",@@ -2975,50 +3283,6 @@ORDER BY "posthog_insightvariable"."name" ASC'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.18- '''- 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_listing_dashboards_is_not_nplus1.19- '''- 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_listing_dashboards_is_not_nplus1.2'''SELECT "posthog_team"."id",@@ -3163,44 +3427,88 @@# ---# name: TestDashboard.test_listing_dashboards_is_not_nplus1.20'''- 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"."insight_id" = 99999+ 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_listing_dashboards_is_not_nplus1.21'''- 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",+ 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_listing_dashboards_is_not_nplus1.22+ '''+ 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"."insight_id" = 99999+ '''+# ---+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23+ '''+ 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",@@ -3215,7 +3523,7 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.22+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -3261,7 +3569,7 @@LIMIT 21'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.23+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -3403,7 +3711,7 @@LIMIT 21'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.24+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -3458,7 +3766,7 @@LIMIT 21'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.25+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -3481,7 +3789,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.26+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -3534,7 +3842,7 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.27+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29'''SELECT COUNT(*) AS "__count"FROM "posthog_dashboard"@@ -3548,7 +3856,62 @@AND NOT ("posthog_dashboard"."creation_mode" = 'unlisted'))'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.28+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -3653,7 +4016,7 @@LIMIT 300'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.29+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.31'''SELECT "posthog_sharingconfiguration"."id","posthog_sharingconfiguration"."team_id",@@ -3676,62 +4039,7 @@5 /* ... */)'''# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.3- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestDashboard.test_listing_dashboards_is_not_nplus1.30+# name: TestDashboard.test_listing_dashboards_is_not_nplus1.32'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -4032,39 +4340,6 @@'''# ---# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.100- '''- 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.101'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -4160,56 +4435,8 @@"posthog_team"."experiment_recalculation_time","posthog_team"."default_experiment_confidence_level","posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model"- FROM "posthog_team"- WHERE "posthog_team"."id" = 99999- LIMIT 21- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.102- '''- 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.103- '''- SELECT "posthog_insightviewed"."id",- "posthog_insightviewed"."team_id",- "posthog_insightviewed"."user_id",- "posthog_insightviewed"."insight_id",- "posthog_insightviewed"."last_viewed_at"- 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.104- '''- SELECT "posthog_organization"."id",+ "posthog_team"."business_model",+ "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -4248,199 +4475,199 @@"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.105- '''- 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"."experiment_recalculation_time",- "posthog_team"."default_experiment_confidence_level",- "posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model"FROM "posthog_team"+ INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")WHERE "posthog_team"."id" = 99999LIMIT 21'''# ----# 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.101'''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted"- 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)+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# 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.102'''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted"- 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)+ SELECT "ee_accesscontrol"."id",+ "ee_accesscontrol"."team_id",+ "ee_accesscontrol"."access_level",+ "ee_accesscontrol"."resource",+ "ee_accesscontrol"."resource_id",+ "ee_accesscontrol"."organization_member_id",+ "ee_accesscontrol"."role_id",+ "ee_accesscontrol"."created_by_id",+ "ee_accesscontrol"."created_at",+ "ee_accesscontrol"."updated_at"+ FROM "ee_accesscontrol"+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))'''# ----# 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.103'''- 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+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# 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.104'''- 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)+ 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.11+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.105+ '''+ SELECT "ee_role"."organization_id" AS "role__organization_id",+ "ee_rolemembership"."role_id" AS "role_id"+ FROM "ee_rolemembership"+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")+ WHERE "ee_rolemembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.106+ '''+ SELECT "posthog_dashboard"."id" AS "id"+ 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 "posthog_dashboard"."id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.107+ '''+ SELECT "posthog_dashboard"."id" AS "id",+ "posthog_dashboard"."name" AS "name"+ 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.108'''SELECT COUNT(*) AS "__count"FROM "posthog_dashboardtile"@@ -4449,10 +4676,11 @@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))+ AND NOT ("posthog_dashboardtile"."deleted"+ AND "posthog_dashboardtile"."deleted" IS NOT 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.109'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -4485,107 +4713,19 @@5 /* ... */))'''# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.111- '''- 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"."insight_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.112- '''- 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.113+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.11'''- 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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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+ 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.114+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.110'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -4681,8 +4821,15 @@"posthog_team"."experiment_recalculation_time","posthog_team"."default_experiment_confidence_level","posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model",- "posthog_organization"."id",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.111+ '''+ SELECT "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -4721,264 +4868,24 @@"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+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuidLIMIT 21'''# ----# 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.112'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.116- '''- SELECT "ee_accesscontrol"."id",- "ee_accesscontrol"."team_id",- "ee_accesscontrol"."access_level",- "ee_accesscontrol"."resource",- "ee_accesscontrol"."resource_id",- "ee_accesscontrol"."organization_member_id",- "ee_accesscontrol"."role_id",- "ee_accesscontrol"."created_by_id",- "ee_accesscontrol"."created_at",- "ee_accesscontrol"."updated_at"- FROM "ee_accesscontrol"- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.117- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.118- '''- 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.119- '''- SELECT "ee_role"."organization_id" AS "role__organization_id",- "ee_rolemembership"."role_id" AS "role_id"- FROM "ee_rolemembership"- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")- WHERE "ee_rolemembership"."user_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"+ SELECT 1 AS "a"FROM "posthog_sharingconfiguration"- WHERE "posthog_sharingconfiguration"."dashboard_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.120- '''- SELECT "posthog_dashboard"."id" AS "id"- 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 "posthog_dashboard"."id" IN (1,- 2,- 3,- 4,- 5 /* ... */))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.121- '''- SELECT "posthog_dashboard"."id" AS "id",- "posthog_dashboard"."name" AS "name"- 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.122- '''- 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"."deleted"- AND "posthog_dashboardtile"."deleted" IS NOT NULL))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.123- '''- 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 /* ... */))+ 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.124+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.113'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -5080,7 +4987,7 @@LIMIT 21'''# ----# 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.114'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -5105,7 +5012,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# 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.115'''SELECT "posthog_insightviewed"."id","posthog_insightviewed"."team_id",@@ -5121,7 +5028,7 @@UPDATE'''# ----# 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.116'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -5167,7 +5074,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.117'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -5269,7 +5176,7 @@LIMIT 21'''# ----# 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.118'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -5296,14 +5203,7 @@AND "posthog_dashboardtile"."insight_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"."dashboard_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.119'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -5330,7 +5230,26 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# 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.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_insightvariable"."id","posthog_insightvariable"."name",@@ -5350,7 +5269,7 @@ORDER BY "posthog_insightvariable"."name" ASC'''# ----# 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.121'''SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"FROM "posthog_dashboardtile"@@ -5361,7 +5280,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# 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.122'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -5394,7 +5313,7 @@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.123'''SELECT "posthog_tag"."name" AS "tag__name"FROM "posthog_taggeditem"@@ -5402,7 +5321,7 @@WHERE "posthog_taggeditem"."insight_id" = 99999'''# ----# 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.124'''SELECT "posthog_user"."id","posthog_user"."password",@@ -5448,7 +5367,7 @@AND "posthog_user"."id" = 99999)'''# ----# 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.125'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -5494,7 +5413,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.126'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -5636,7 +5555,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.127'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -5691,7 +5610,7 @@LIMIT 21'''# ----# 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.128'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -5714,23 +5633,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# 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.129'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -5783,7 +5686,14 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# 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.13+ '''+ SELECT COUNT(*) AS "__count"+ FROM "posthog_taggeditem"+ WHERE "posthog_taggeditem"."dashboard_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.130'''SELECT "ee_accesscontrol"."team_id" AS "team_id","ee_accesscontrol"."resource_id" AS "resource_id",@@ -5796,7 +5706,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.142+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.131'''SELECT "ee_role"."organization_id" AS "role__organization_id","ee_rolemembership"."role_id" AS "role_id"@@ -5805,7 +5715,53 @@WHERE "ee_rolemembership"."user_id" = 99999'''# ----# 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.132+ '''+ SELECT "posthog_dashboard"."id" AS "id"+ 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 "posthog_dashboard"."id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.133+ '''+ SELECT "posthog_dashboard"."id" AS "id",+ "posthog_dashboard"."name" AS "name"+ 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.134+ '''+ 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"."deleted"+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.135'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -5828,158 +5784,19 @@"posthog_dashboard"."deprecated_tags","posthog_dashboard"."tags","posthog_dashboard"."share_token",- "posthog_dashboard"."is_shared",- recent_dashboard_views."viewed_at" AS "last_viewed_at",- ("posthog_dashboard"."id")::varchar AS "_ref_id",-- (SELECT U0."path" AS "path"- FROM "posthog_filesystem" U0- WHERE ((U0."surface" IS NULL- OR U0."surface" = 'web')- AND U0."ref" = ("posthog_dashboard"."id")::varchar- AND U0."team_id" = ("posthog_dashboard"."team_id")- AND U0."type" = 'dashboard'- AND NOT (U0."shortcut"- AND U0."shortcut" IS NOT NULL))- ORDER BY U0."id" ASC- LIMIT 1) AS "_folder_path",-- (SELECT U0."id" AS "id"- FROM "posthog_filesystem" U0- WHERE ((U0."surface" IS NULL- OR U0."surface" = 'web')- AND U0."ref" = ("posthog_dashboard"."id")::varchar- AND U0."team_id" = ("posthog_dashboard"."team_id")- AND U0."type" = 'dashboard'- AND NOT (U0."shortcut"- AND U0."shortcut" IS NOT NULL))- ORDER BY 1 ASC- LIMIT 1) AS "_folder_id",- T6."id",- T6."password",- T6."last_login",- T6."first_name",- T6."last_name",- T6."is_staff",- T6."date_joined",- T6."uuid",- T6."current_organization_id",- T6."current_team_id",- T6."email",- T6."pending_email",- T6."distinct_id",- T6."is_email_verified",- T6."credentials_reviewed_at",- T6."requested_password_reset_at",- T6."requested_2fa_reset_at",- T6."has_seen_product_intro_for",- T6."strapi_id",- T6."is_active",- T6."role_at_organization",- T6."theme_mode",- T6."partial_notification_settings",- T6."anonymize_data",- T6."allow_impersonation",- T6."toolbar_mode",- T6."hedgehog_config",- T6."allow_sidebar_suggestions",- T6."shortcut_position",- T6."passkeys_enabled_for_2fa",- T6."hide_mcp_hints",- T6."ui_configuration",- T6."onboarding_skipped_at",- T6."onboarding_skipped_reason",- T6."onboarding_skipped_organization_id",- T6."onboarding_delegated_to_invite_id",- T6."onboarding_delegated_to_organization_id",- T6."onboarding_delegation_accepted_at",- T6."events_column_config",- T6."email_opt_in"+ "posthog_dashboard"."is_shared"FROM "posthog_dashboard"- INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"- AND ((recent_dashboard_views."user_id" = 99999- AND recent_dashboard_views."type" = 'dashboard'- AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")- WHERE ("posthog_team"."project_id" = 99999- AND NOT ("posthog_dashboard"."deleted")- AND "posthog_dashboard"."id" = 99999)- LIMIT 21- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.144- '''- 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" IN (1,- 2,- 3,- 4,- 5 /* ... */)+ 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.145+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.136'''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted",- "posthog_dashboarditem"."id",- "posthog_dashboarditem"."name",- "posthog_dashboarditem"."derived_name",- "posthog_dashboarditem"."description",- "posthog_dashboarditem"."team_id",- "posthog_dashboarditem"."filters",- "posthog_dashboarditem"."filters_hash",- "posthog_dashboarditem"."query",- "posthog_dashboarditem"."query_metadata",- "posthog_dashboarditem"."order",- "posthog_dashboarditem"."deleted",- "posthog_dashboarditem"."saved",- "posthog_dashboarditem"."created_at",- "posthog_dashboarditem"."refreshing",- "posthog_dashboarditem"."created_by_id",- "posthog_dashboarditem"."is_sample",- "posthog_dashboarditem"."short_id",- "posthog_dashboarditem"."favorited",- "posthog_dashboarditem"."refresh_attempt",- "posthog_dashboarditem"."last_modified_at",- "posthog_dashboarditem"."last_modified_by_id",- "posthog_dashboarditem"."dashboard_id",- "posthog_dashboarditem"."last_refresh",- "posthog_dashboarditem"."layouts",- "posthog_dashboarditem"."color",- "posthog_dashboarditem"."dive_dashboard_id",- "posthog_dashboarditem"."updated_at",- "posthog_dashboarditem"."deprecated_tags",- "posthog_dashboarditem"."tags",- "posthog_team"."id",+ SELECT "posthog_team"."id","posthog_team"."uuid","posthog_team"."organization_id","posthog_team"."parent_team_id",@@ -6065,382 +5882,79 @@"posthog_team"."modifiers","posthog_team"."correlation_config","posthog_team"."session_recording_retention_period_days",- "posthog_team"."plugins_opt_in",- "posthog_team"."opt_out_capture",- "posthog_team"."event_names",- "posthog_team"."event_names_with_usage",- "posthog_team"."event_properties",- "posthog_team"."event_properties_with_usage",- "posthog_team"."event_properties_numerical","posthog_team"."external_data_workspace_id","posthog_team"."external_data_workspace_last_synced_at","posthog_team"."api_query_rate_limit",- "posthog_team"."revenue_tracking_config","posthog_team"."drop_events_older_than","posthog_team"."base_currency","posthog_team"."experiment_recalculation_time","posthog_team"."default_experiment_confidence_level","posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model",- "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_password_reset_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",- T6."id",- T6."password",- T6."last_login",- T6."first_name",- T6."last_name",- T6."is_staff",- T6."date_joined",- T6."uuid",- T6."current_organization_id",- T6."current_team_id",- T6."email",- T6."pending_email",- T6."distinct_id",- T6."is_email_verified",- T6."credentials_reviewed_at",- T6."requested_password_reset_at",- T6."requested_2fa_reset_at",- T6."has_seen_product_intro_for",- T6."strapi_id",- T6."is_active",- T6."role_at_organization",- T6."theme_mode",- T6."partial_notification_settings",- T6."anonymize_data",- T6."allow_impersonation",- T6."toolbar_mode",- T6."hedgehog_config",- T6."allow_sidebar_suggestions",- T6."shortcut_position",- T6."passkeys_enabled_for_2fa",- T6."hide_mcp_hints",- T6."ui_configuration",- T6."onboarding_skipped_at",- T6."onboarding_skipped_reason",- T6."onboarding_skipped_organization_id",- T6."onboarding_delegated_to_invite_id",- T6."onboarding_delegated_to_organization_id",- T6."onboarding_delegation_accepted_at",- T6."events_column_config",- T6."email_opt_in",- "posthog_text"."id",- "posthog_text"."body",- "posthog_text"."created_by_id",- "posthog_text"."last_modified_at",- "posthog_text"."last_modified_by_id",- "posthog_text"."team_id",- "posthog_buttontile"."id",- "posthog_buttontile"."url",- "posthog_buttontile"."text",- "posthog_buttontile"."placement",- "posthog_buttontile"."style",- "posthog_buttontile"."created_by_id",- "posthog_buttontile"."last_modified_at",- "posthog_buttontile"."last_modified_by_id",- "posthog_buttontile"."team_id",- "posthog_dashboardwidget"."id",- "posthog_dashboardwidget"."widget_type",- "posthog_dashboardwidget"."name",- "posthog_dashboardwidget"."description",- "posthog_dashboardwidget"."config",- "posthog_dashboardwidget"."created_by_id",- "posthog_dashboardwidget"."last_modified_at",- "posthog_dashboardwidget"."last_modified_by_id",- "posthog_dashboardwidget"."team_id",- T10."id",- T10."password",- T10."last_login",- T10."first_name",- T10."last_name",- T10."is_staff",- T10."date_joined",- T10."uuid",- T10."current_organization_id",- T10."current_team_id",- T10."email",- T10."pending_email",- T10."distinct_id",- T10."is_email_verified",- T10."credentials_reviewed_at",- T10."requested_password_reset_at",- T10."requested_2fa_reset_at",- T10."has_seen_product_intro_for",- T10."strapi_id",- T10."is_active",- T10."role_at_organization",- T10."theme_mode",- T10."partial_notification_settings",- T10."anonymize_data",- T10."allow_impersonation",- T10."toolbar_mode",- T10."hedgehog_config",- T10."allow_sidebar_suggestions",- T10."shortcut_position",- T10."passkeys_enabled_for_2fa",- T10."hide_mcp_hints",- T10."ui_configuration",- T10."onboarding_skipped_at",- T10."onboarding_skipped_reason",- T10."onboarding_skipped_organization_id",- T10."onboarding_delegated_to_invite_id",- T10."onboarding_delegated_to_organization_id",- T10."onboarding_delegation_accepted_at",- T10."events_column_config",- T10."email_opt_in",- T11."id",- T11."password",- T11."last_login",- T11."first_name",- T11."last_name",- T11."is_staff",- T11."date_joined",- T11."uuid",- T11."current_organization_id",- T11."current_team_id",- T11."email",- T11."pending_email",- T11."distinct_id",- T11."is_email_verified",- T11."credentials_reviewed_at",- T11."requested_password_reset_at",- T11."requested_2fa_reset_at",- T11."has_seen_product_intro_for",- T11."strapi_id",- T11."is_active",- T11."role_at_organization",- T11."theme_mode",- T11."partial_notification_settings",- T11."anonymize_data",- T11."allow_impersonation",- T11."toolbar_mode",- T11."hedgehog_config",- T11."allow_sidebar_suggestions",- T11."shortcut_position",- T11."passkeys_enabled_for_2fa",- T11."hide_mcp_hints",- T11."ui_configuration",- T11."onboarding_skipped_at",- T11."onboarding_skipped_reason",- T11."onboarding_skipped_organization_id",- T11."onboarding_delegated_to_invite_id",- T11."onboarding_delegated_to_organization_id",- T11."onboarding_delegation_accepted_at",- T11."events_column_config",- T11."email_opt_in"- FROM "posthog_dashboardtile"- INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")- LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")- LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")- LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")- LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")- LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")- LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")- LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")- LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")- WHERE (NOT ("posthog_dashboardtile"."deleted"- AND "posthog_dashboardtile"."deleted" IS NOT NULL)- AND NOT ("posthog_dashboard"."deleted")- AND NOT ("posthog_dashboard"."deleted"- AND "posthog_dashboardtile"."deleted"- AND "posthog_dashboardtile"."deleted" IS NOT NULL)- AND (NOT "posthog_dashboarditem"."deleted"- OR "posthog_dashboardtile"."insight_id" IS NULL)- AND "posthog_dashboardtile"."dashboard_id" = 99999- AND "posthog_dashboardtile"."dashboard_id" IN (1,- 2,- 3,- 4,- 5 /* ... */))- ORDER BY "posthog_dashboarditem"."order" ASC+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21'''# ----# 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.137'''- SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",- "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"- INNER JOIN "posthog_dashboardtile" ON ("posthog_dashboard"."id" = "posthog_dashboardtile"."dashboard_id")- WHERE (NOT ("posthog_dashboard"."deleted")- AND "posthog_dashboard"."id" IN- (SELECT U0."dashboard_id" AS "dashboard_id"- FROM "posthog_dashboardtile" U0- INNER JOIN "posthog_dashboard" U1 ON (U0."dashboard_id" = U1."id")- WHERE (NOT (U0."deleted"- AND U0."deleted" IS NOT NULL)- AND NOT (U1."deleted")))- AND "posthog_dashboardtile"."insight_id" IN (1,- 2,- 3,- 4,- 5 /* ... */))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.147- '''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted"- 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" IN (1,- 2,- 3,- 4,- 5 /* ... */))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.148- '''- 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 ("posthog_dashboard"."id") IN ((1,- 2)/* ... */)- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.149- '''- SELECT "posthog_taggeditem"."id",- "posthog_taggeditem"."tag_id",- "posthog_taggeditem"."dashboard_id",- "posthog_taggeditem"."insight_id",- "posthog_taggeditem"."event_definition_id",- "posthog_taggeditem"."property_definition_id",- "posthog_taggeditem"."action_id",- "posthog_taggeditem"."feature_flag_id",- "posthog_taggeditem"."experiment_saved_metric_id",- "posthog_taggeditem"."ticket_id",- "posthog_taggeditem"."account_id",- "posthog_taggeditem"."endpoint_id",- "posthog_taggeditem"."replay_scanner_id",- "posthog_taggeditem"."project_id",- "posthog_tag"."id",- "posthog_tag"."name",- "posthog_tag"."team_id"- FROM "posthog_taggeditem"- INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")- WHERE "posthog_taggeditem"."dashboard_id" IN (1,- 2,- 3,- 4,- 5 /* ... */)+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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.15+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.138'''- 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+ 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.150+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.139'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -6542,7 +6056,23 @@LIMIT 21'''# ----# 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.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'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -6562,103 +6092,76 @@OR "posthog_filesystem"."surface" = 'web')AND "posthog_filesystem"."ref" = '0001'AND "posthog_filesystem"."team_id" = 99999- AND "posthog_filesystem"."type" = 'dashboard'+ 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.152- '''- SELECT "posthog_filesystemshortcut"."id",- "posthog_filesystemshortcut"."team_id",- "posthog_filesystemshortcut"."user_id",- "posthog_filesystemshortcut"."path",- "posthog_filesystemshortcut"."type",- "posthog_filesystemshortcut"."ref",- "posthog_filesystemshortcut"."href",- "posthog_filesystemshortcut"."order",- "posthog_filesystemshortcut"."created_at",- "posthog_filesystemshortcut"."surface"- FROM "posthog_filesystemshortcut"- WHERE (("posthog_filesystemshortcut"."surface" IS NULL- OR "posthog_filesystemshortcut"."surface" = 'web')- AND "posthog_filesystemshortcut"."ref" = '0001'- AND "posthog_filesystemshortcut"."team_id" = 99999- AND "posthog_filesystemshortcut"."type" = 'dashboard'- AND NOT ("posthog_filesystemshortcut"."path" = 'dashboard-1'- AND "posthog_filesystemshortcut"."href" = '__skipped__'- AND "posthog_filesystemshortcut"."href" IS NOT NULL))- '''-# ----# 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.141'''- 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+ SELECT "posthog_insightviewed"."id",+ "posthog_insightviewed"."team_id",+ "posthog_insightviewed"."user_id",+ "posthog_insightviewed"."insight_id",+ "posthog_insightviewed"."last_viewed_at"+ 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.154+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.142'''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted",- "posthog_dashboarditem"."id",- "posthog_dashboarditem"."name",- "posthog_dashboarditem"."derived_name",- "posthog_dashboarditem"."description",- "posthog_dashboarditem"."team_id",- "posthog_dashboarditem"."filters",- "posthog_dashboarditem"."filters_hash",- "posthog_dashboarditem"."query",- "posthog_dashboarditem"."query_metadata",- "posthog_dashboarditem"."order",- "posthog_dashboarditem"."deleted",- "posthog_dashboarditem"."saved",- "posthog_dashboarditem"."created_at",- "posthog_dashboarditem"."refreshing",- "posthog_dashboarditem"."created_by_id",- "posthog_dashboarditem"."is_sample",- "posthog_dashboarditem"."short_id",- "posthog_dashboarditem"."favorited",- "posthog_dashboarditem"."refresh_attempt",- "posthog_dashboarditem"."last_modified_at",- "posthog_dashboarditem"."last_modified_by_id",- "posthog_dashboarditem"."dashboard_id",- "posthog_dashboarditem"."last_refresh",- "posthog_dashboarditem"."layouts",- "posthog_dashboarditem"."color",- "posthog_dashboarditem"."dive_dashboard_id",- "posthog_dashboarditem"."updated_at",- "posthog_dashboarditem"."deprecated_tags",- "posthog_dashboarditem"."tags",- "posthog_team"."id",+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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.143+ '''+ SELECT "posthog_team"."id","posthog_team"."uuid","posthog_team"."organization_id","posthog_team"."parent_team_id",@@ -6744,24 +6247,165 @@"posthog_team"."modifiers","posthog_team"."correlation_config","posthog_team"."session_recording_retention_period_days",- "posthog_team"."plugins_opt_in",- "posthog_team"."opt_out_capture",- "posthog_team"."event_names",- "posthog_team"."event_names_with_usage",- "posthog_team"."event_properties",- "posthog_team"."event_properties_with_usage",- "posthog_team"."event_properties_numerical","posthog_team"."external_data_workspace_id","posthog_team"."external_data_workspace_last_synced_at","posthog_team"."api_query_rate_limit",- "posthog_team"."revenue_tracking_config","posthog_team"."drop_events_older_than","posthog_team"."base_currency","posthog_team"."experiment_recalculation_time","posthog_team"."default_experiment_confidence_level","posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model",- "posthog_user"."id",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.144+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted"+ 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.145+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted"+ 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.146+ '''+ 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.147+ '''+ 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.148+ '''+ 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.149+ '''+ 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"."insight_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+ '''+ SELECT "posthog_user"."id","posthog_user"."password","posthog_user"."last_login","posthog_user"."first_name",@@ -6776,7 +6420,6 @@"posthog_user"."distinct_id","posthog_user"."is_email_verified","posthog_user"."credentials_reviewed_at",- "posthog_user"."requested_password_reset_at","posthog_user"."requested_2fa_reset_at","posthog_user"."has_seen_product_intro_for","posthog_user"."strapi_id",@@ -6800,10 +6443,1352 @@"posthog_user"."onboarding_delegated_to_organization_id","posthog_user"."onboarding_delegation_accepted_at","posthog_user"."events_column_config",- "posthog_user"."email_opt_in",- T6."id",- T6."password",- T6."last_login",+ "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.151+ '''+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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.152+ '''+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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.153+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.154+ '''+ SELECT "ee_accesscontrol"."id",+ "ee_accesscontrol"."team_id",+ "ee_accesscontrol"."access_level",+ "ee_accesscontrol"."resource",+ "ee_accesscontrol"."resource_id",+ "ee_accesscontrol"."organization_member_id",+ "ee_accesscontrol"."role_id",+ "ee_accesscontrol"."created_by_id",+ "ee_accesscontrol"."created_at",+ "ee_accesscontrol"."updated_at"+ FROM "ee_accesscontrol"+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.155+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.156+ '''+ 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.157+ '''+ SELECT "ee_role"."organization_id" AS "role__organization_id",+ "ee_rolemembership"."role_id" AS "role_id"+ FROM "ee_rolemembership"+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")+ WHERE "ee_rolemembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.158+ '''+ 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",+ recent_dashboard_views."viewed_at" AS "last_viewed_at",+ ("posthog_dashboard"."id")::varchar AS "_ref_id",++ (SELECT U0."path" AS "path"+ FROM "posthog_filesystem" U0+ WHERE ((U0."surface" IS NULL+ OR U0."surface" = 'web')+ AND U0."ref" = ("posthog_dashboard"."id")::varchar+ AND U0."team_id" = ("posthog_dashboard"."team_id")+ AND U0."type" = 'dashboard'+ AND NOT (U0."shortcut"+ AND U0."shortcut" IS NOT NULL))+ ORDER BY U0."id" ASC+ LIMIT 1) AS "_folder_path",++ (SELECT U0."id" AS "id"+ FROM "posthog_filesystem" U0+ WHERE ((U0."surface" IS NULL+ OR U0."surface" = 'web')+ AND U0."ref" = ("posthog_dashboard"."id")::varchar+ AND U0."team_id" = ("posthog_dashboard"."team_id")+ AND U0."type" = 'dashboard'+ AND NOT (U0."shortcut"+ AND U0."shortcut" IS NOT NULL))+ ORDER BY 1 ASC+ LIMIT 1) AS "_folder_id",+ T6."id",+ T6."password",+ T6."last_login",+ T6."first_name",+ T6."last_name",+ T6."is_staff",+ T6."date_joined",+ T6."uuid",+ T6."current_organization_id",+ T6."current_team_id",+ T6."email",+ T6."pending_email",+ T6."distinct_id",+ T6."is_email_verified",+ T6."credentials_reviewed_at",+ T6."requested_password_reset_at",+ T6."requested_2fa_reset_at",+ T6."has_seen_product_intro_for",+ T6."strapi_id",+ T6."is_active",+ T6."role_at_organization",+ T6."theme_mode",+ T6."partial_notification_settings",+ T6."anonymize_data",+ T6."allow_impersonation",+ T6."toolbar_mode",+ T6."hedgehog_config",+ T6."allow_sidebar_suggestions",+ T6."shortcut_position",+ T6."passkeys_enabled_for_2fa",+ T6."hide_mcp_hints",+ T6."ui_configuration",+ T6."onboarding_skipped_at",+ T6."onboarding_skipped_reason",+ T6."onboarding_skipped_organization_id",+ T6."onboarding_delegated_to_invite_id",+ T6."onboarding_delegated_to_organization_id",+ T6."onboarding_delegation_accepted_at",+ T6."events_column_config",+ T6."email_opt_in"+ FROM "posthog_dashboard"+ INNER JOIN "posthog_team" ON ("posthog_dashboard"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_filesystemviewlog" recent_dashboard_views ON ("posthog_team"."id" = recent_dashboard_views."team_id"+ AND ((recent_dashboard_views."user_id" = 99999+ AND recent_dashboard_views."type" = 'dashboard'+ AND recent_dashboard_views."ref" = ("posthog_dashboard"."id")::varchar)))+ LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboard"."created_by_id" = T6."id")+ WHERE ("posthog_team"."project_id" = 99999+ AND NOT ("posthog_dashboard"."deleted")+ AND "posthog_dashboard"."id" = 99999)+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.159+ '''+ 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" IN (1,+ 2,+ 3,+ 4,+ 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+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted",+ "posthog_dashboarditem"."id",+ "posthog_dashboarditem"."name",+ "posthog_dashboarditem"."derived_name",+ "posthog_dashboarditem"."description",+ "posthog_dashboarditem"."team_id",+ "posthog_dashboarditem"."filters",+ "posthog_dashboarditem"."filters_hash",+ "posthog_dashboarditem"."query",+ "posthog_dashboarditem"."query_metadata",+ "posthog_dashboarditem"."order",+ "posthog_dashboarditem"."deleted",+ "posthog_dashboarditem"."saved",+ "posthog_dashboarditem"."created_at",+ "posthog_dashboarditem"."refreshing",+ "posthog_dashboarditem"."created_by_id",+ "posthog_dashboarditem"."is_sample",+ "posthog_dashboarditem"."short_id",+ "posthog_dashboarditem"."favorited",+ "posthog_dashboarditem"."refresh_attempt",+ "posthog_dashboarditem"."last_modified_at",+ "posthog_dashboarditem"."last_modified_by_id",+ "posthog_dashboarditem"."dashboard_id",+ "posthog_dashboarditem"."last_refresh",+ "posthog_dashboarditem"."layouts",+ "posthog_dashboarditem"."color",+ "posthog_dashboarditem"."dive_dashboard_id",+ "posthog_dashboarditem"."updated_at",+ "posthog_dashboarditem"."deprecated_tags",+ "posthog_dashboarditem"."tags",+ "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"."plugins_opt_in",+ "posthog_team"."opt_out_capture",+ "posthog_team"."event_names",+ "posthog_team"."event_names_with_usage",+ "posthog_team"."event_properties",+ "posthog_team"."event_properties_with_usage",+ "posthog_team"."event_properties_numerical",+ "posthog_team"."external_data_workspace_id",+ "posthog_team"."external_data_workspace_last_synced_at",+ "posthog_team"."api_query_rate_limit",+ "posthog_team"."revenue_tracking_config",+ "posthog_team"."drop_events_older_than",+ "posthog_team"."base_currency",+ "posthog_team"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model",+ "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_password_reset_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",+ T6."id",+ T6."password",+ T6."last_login",+ T6."first_name",+ T6."last_name",+ T6."is_staff",+ T6."date_joined",+ T6."uuid",+ T6."current_organization_id",+ T6."current_team_id",+ T6."email",+ T6."pending_email",+ T6."distinct_id",+ T6."is_email_verified",+ T6."credentials_reviewed_at",+ T6."requested_password_reset_at",+ T6."requested_2fa_reset_at",+ T6."has_seen_product_intro_for",+ T6."strapi_id",+ T6."is_active",+ T6."role_at_organization",+ T6."theme_mode",+ T6."partial_notification_settings",+ T6."anonymize_data",+ T6."allow_impersonation",+ T6."toolbar_mode",+ T6."hedgehog_config",+ T6."allow_sidebar_suggestions",+ T6."shortcut_position",+ T6."passkeys_enabled_for_2fa",+ T6."hide_mcp_hints",+ T6."ui_configuration",+ T6."onboarding_skipped_at",+ T6."onboarding_skipped_reason",+ T6."onboarding_skipped_organization_id",+ T6."onboarding_delegated_to_invite_id",+ T6."onboarding_delegated_to_organization_id",+ T6."onboarding_delegation_accepted_at",+ T6."events_column_config",+ T6."email_opt_in",+ "posthog_text"."id",+ "posthog_text"."body",+ "posthog_text"."created_by_id",+ "posthog_text"."last_modified_at",+ "posthog_text"."last_modified_by_id",+ "posthog_text"."team_id",+ "posthog_buttontile"."id",+ "posthog_buttontile"."url",+ "posthog_buttontile"."text",+ "posthog_buttontile"."placement",+ "posthog_buttontile"."style",+ "posthog_buttontile"."created_by_id",+ "posthog_buttontile"."last_modified_at",+ "posthog_buttontile"."last_modified_by_id",+ "posthog_buttontile"."team_id",+ "posthog_dashboardwidget"."id",+ "posthog_dashboardwidget"."widget_type",+ "posthog_dashboardwidget"."name",+ "posthog_dashboardwidget"."description",+ "posthog_dashboardwidget"."config",+ "posthog_dashboardwidget"."created_by_id",+ "posthog_dashboardwidget"."last_modified_at",+ "posthog_dashboardwidget"."last_modified_by_id",+ "posthog_dashboardwidget"."team_id",+ T10."id",+ T10."password",+ T10."last_login",+ T10."first_name",+ T10."last_name",+ T10."is_staff",+ T10."date_joined",+ T10."uuid",+ T10."current_organization_id",+ T10."current_team_id",+ T10."email",+ T10."pending_email",+ T10."distinct_id",+ T10."is_email_verified",+ T10."credentials_reviewed_at",+ T10."requested_password_reset_at",+ T10."requested_2fa_reset_at",+ T10."has_seen_product_intro_for",+ T10."strapi_id",+ T10."is_active",+ T10."role_at_organization",+ T10."theme_mode",+ T10."partial_notification_settings",+ T10."anonymize_data",+ T10."allow_impersonation",+ T10."toolbar_mode",+ T10."hedgehog_config",+ T10."allow_sidebar_suggestions",+ T10."shortcut_position",+ T10."passkeys_enabled_for_2fa",+ T10."hide_mcp_hints",+ T10."ui_configuration",+ T10."onboarding_skipped_at",+ T10."onboarding_skipped_reason",+ T10."onboarding_skipped_organization_id",+ T10."onboarding_delegated_to_invite_id",+ T10."onboarding_delegated_to_organization_id",+ T10."onboarding_delegation_accepted_at",+ T10."events_column_config",+ T10."email_opt_in",+ T11."id",+ T11."password",+ T11."last_login",+ T11."first_name",+ T11."last_name",+ T11."is_staff",+ T11."date_joined",+ T11."uuid",+ T11."current_organization_id",+ T11."current_team_id",+ T11."email",+ T11."pending_email",+ T11."distinct_id",+ T11."is_email_verified",+ T11."credentials_reviewed_at",+ T11."requested_password_reset_at",+ T11."requested_2fa_reset_at",+ T11."has_seen_product_intro_for",+ T11."strapi_id",+ T11."is_active",+ T11."role_at_organization",+ T11."theme_mode",+ T11."partial_notification_settings",+ T11."anonymize_data",+ T11."allow_impersonation",+ T11."toolbar_mode",+ T11."hedgehog_config",+ T11."allow_sidebar_suggestions",+ T11."shortcut_position",+ T11."passkeys_enabled_for_2fa",+ T11."hide_mcp_hints",+ T11."ui_configuration",+ T11."onboarding_skipped_at",+ T11."onboarding_skipped_reason",+ T11."onboarding_skipped_organization_id",+ T11."onboarding_delegated_to_invite_id",+ T11."onboarding_delegated_to_organization_id",+ T11."onboarding_delegation_accepted_at",+ T11."events_column_config",+ T11."email_opt_in"+ FROM "posthog_dashboardtile"+ INNER JOIN "posthog_dashboard" ON ("posthog_dashboardtile"."dashboard_id" = "posthog_dashboard"."id")+ LEFT OUTER JOIN "posthog_dashboarditem" ON ("posthog_dashboardtile"."insight_id" = "posthog_dashboarditem"."id")+ LEFT OUTER JOIN "posthog_team" ON ("posthog_dashboarditem"."team_id" = "posthog_team"."id")+ LEFT OUTER JOIN "posthog_user" ON ("posthog_dashboarditem"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_user" T6 ON ("posthog_dashboarditem"."last_modified_by_id" = T6."id")+ LEFT OUTER JOIN "posthog_text" ON ("posthog_dashboardtile"."text_id" = "posthog_text"."id")+ LEFT OUTER JOIN "posthog_buttontile" ON ("posthog_dashboardtile"."button_tile_id" = "posthog_buttontile"."id")+ LEFT OUTER JOIN "posthog_dashboardwidget" ON ("posthog_dashboardtile"."widget_id" = "posthog_dashboardwidget"."id")+ LEFT OUTER JOIN "posthog_user" T10 ON ("posthog_dashboardwidget"."created_by_id" = T10."id")+ LEFT OUTER JOIN "posthog_user" T11 ON ("posthog_dashboardwidget"."last_modified_by_id" = T11."id")+ WHERE (NOT ("posthog_dashboardtile"."deleted"+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)+ AND NOT ("posthog_dashboard"."deleted")+ AND NOT ("posthog_dashboard"."deleted"+ AND "posthog_dashboardtile"."deleted"+ AND "posthog_dashboardtile"."deleted" IS NOT NULL)+ AND (NOT "posthog_dashboarditem"."deleted"+ OR "posthog_dashboardtile"."insight_id" IS NULL)+ AND "posthog_dashboardtile"."dashboard_id" = 99999+ AND "posthog_dashboardtile"."dashboard_id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ ORDER BY "posthog_dashboarditem"."order" ASC+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.161+ '''+ SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id",+ "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"+ INNER JOIN "posthog_dashboardtile" ON ("posthog_dashboard"."id" = "posthog_dashboardtile"."dashboard_id")+ WHERE (NOT ("posthog_dashboard"."deleted")+ AND "posthog_dashboard"."id" IN+ (SELECT U0."dashboard_id" AS "dashboard_id"+ FROM "posthog_dashboardtile" U0+ INNER JOIN "posthog_dashboard" U1 ON (U0."dashboard_id" = U1."id")+ WHERE (NOT (U0."deleted"+ AND U0."deleted" IS NOT NULL)+ AND NOT (U1."deleted")))+ AND "posthog_dashboardtile"."insight_id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.162+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted"+ 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" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.163+ '''+ 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 ("posthog_dashboard"."id") IN ((1,+ 2)/* ... */)+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.164+ '''+ SELECT "posthog_taggeditem"."id",+ "posthog_taggeditem"."tag_id",+ "posthog_taggeditem"."dashboard_id",+ "posthog_taggeditem"."insight_id",+ "posthog_taggeditem"."event_definition_id",+ "posthog_taggeditem"."property_definition_id",+ "posthog_taggeditem"."action_id",+ "posthog_taggeditem"."feature_flag_id",+ "posthog_taggeditem"."experiment_saved_metric_id",+ "posthog_taggeditem"."ticket_id",+ "posthog_taggeditem"."account_id",+ "posthog_taggeditem"."endpoint_id",+ "posthog_taggeditem"."replay_scanner_id",+ "posthog_taggeditem"."project_id",+ "posthog_tag"."id",+ "posthog_tag"."name",+ "posthog_tag"."team_id"+ FROM "posthog_taggeditem"+ INNER JOIN "posthog_tag" ON ("posthog_taggeditem"."tag_id" = "posthog_tag"."id")+ WHERE "posthog_taggeditem"."dashboard_id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */)+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.165+ '''+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.166+ '''+ 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" = 'dashboard'+ AND NOT ("posthog_filesystem"."shortcut"+ AND "posthog_filesystem"."shortcut" IS NOT NULL))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.167+ '''+ SELECT "posthog_filesystemshortcut"."id",+ "posthog_filesystemshortcut"."team_id",+ "posthog_filesystemshortcut"."user_id",+ "posthog_filesystemshortcut"."path",+ "posthog_filesystemshortcut"."type",+ "posthog_filesystemshortcut"."ref",+ "posthog_filesystemshortcut"."href",+ "posthog_filesystemshortcut"."order",+ "posthog_filesystemshortcut"."created_at",+ "posthog_filesystemshortcut"."surface"+ FROM "posthog_filesystemshortcut"+ WHERE (("posthog_filesystemshortcut"."surface" IS NULL+ OR "posthog_filesystemshortcut"."surface" = 'web')+ AND "posthog_filesystemshortcut"."ref" = '0001'+ AND "posthog_filesystemshortcut"."team_id" = 99999+ AND "posthog_filesystemshortcut"."type" = 'dashboard'+ AND NOT ("posthog_filesystemshortcut"."path" = 'dashboard-1'+ AND "posthog_filesystemshortcut"."href" = '__skipped__'+ AND "posthog_filesystemshortcut"."href" IS NOT NULL))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.168+ '''+ 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.169+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted",+ "posthog_dashboarditem"."id",+ "posthog_dashboarditem"."name",+ "posthog_dashboarditem"."derived_name",+ "posthog_dashboarditem"."description",+ "posthog_dashboarditem"."team_id",+ "posthog_dashboarditem"."filters",+ "posthog_dashboarditem"."filters_hash",+ "posthog_dashboarditem"."query",+ "posthog_dashboarditem"."query_metadata",+ "posthog_dashboarditem"."order",+ "posthog_dashboarditem"."deleted",+ "posthog_dashboarditem"."saved",+ "posthog_dashboarditem"."created_at",+ "posthog_dashboarditem"."refreshing",+ "posthog_dashboarditem"."created_by_id",+ "posthog_dashboarditem"."is_sample",+ "posthog_dashboarditem"."short_id",+ "posthog_dashboarditem"."favorited",+ "posthog_dashboarditem"."refresh_attempt",+ "posthog_dashboarditem"."last_modified_at",+ "posthog_dashboarditem"."last_modified_by_id",+ "posthog_dashboarditem"."dashboard_id",+ "posthog_dashboarditem"."last_refresh",+ "posthog_dashboarditem"."layouts",+ "posthog_dashboarditem"."color",+ "posthog_dashboarditem"."dive_dashboard_id",+ "posthog_dashboarditem"."updated_at",+ "posthog_dashboarditem"."deprecated_tags",+ "posthog_dashboarditem"."tags",+ "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"."plugins_opt_in",+ "posthog_team"."opt_out_capture",+ "posthog_team"."event_names",+ "posthog_team"."event_names_with_usage",+ "posthog_team"."event_properties",+ "posthog_team"."event_properties_with_usage",+ "posthog_team"."event_properties_numerical",+ "posthog_team"."external_data_workspace_id",+ "posthog_team"."external_data_workspace_last_synced_at",+ "posthog_team"."api_query_rate_limit",+ "posthog_team"."revenue_tracking_config",+ "posthog_team"."drop_events_older_than",+ "posthog_team"."base_currency",+ "posthog_team"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model",+ "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_password_reset_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",+ T6."id",+ T6."password",+ T6."last_login",T6."first_name",T6."last_name",T6."is_staff",@@ -6974,7 +7959,26 @@ORDER BY "posthog_dashboarditem"."order" ASC'''# ----# 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.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'''SELECT ("posthog_dashboardtile"."insight_id") AS "_prefetch_related_val_insight_id","posthog_dashboard"."id",@@ -7016,7 +8020,7 @@5 /* ... */))'''# ----# 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.171'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -7047,7 +8051,7 @@5 /* ... */))'''# ----# 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.172'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -7076,7 +8080,7 @@2)/* ... */)'''# ----# 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.173'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",@@ -7104,7 +8108,7 @@5 /* ... */)'''# ----# 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.174'''SELECT "posthog_alertconfiguration"."created_by_id","posthog_alertconfiguration"."created_at",@@ -7176,32 +8180,16 @@"posthog_threshold"."name","posthog_threshold"."configuration"FROM "posthog_alertconfiguration"- LEFT OUTER JOIN "posthog_user" ON ("posthog_alertconfiguration"."created_by_id" = "posthog_user"."id")- LEFT OUTER JOIN "posthog_threshold" ON ("posthog_alertconfiguration"."threshold_id" = "posthog_threshold"."id")- WHERE "posthog_alertconfiguration"."insight_id" IN (1,- 2,- 3,- 4,- 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+ LEFT OUTER JOIN "posthog_user" ON ("posthog_alertconfiguration"."created_by_id" = "posthog_user"."id")+ LEFT OUTER JOIN "posthog_threshold" ON ("posthog_alertconfiguration"."threshold_id" = "posthog_threshold"."id")+ WHERE "posthog_alertconfiguration"."insight_id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */)'''# ----# 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.175'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -7234,25 +8222,6 @@5 /* ... */))'''# ----# 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.18'''SELECT "posthog_insightvariable"."id",@@ -8872,63 +9841,336 @@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.41+ '''+ 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"."dashboard_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.42+ '''+ 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.43+ '''+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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.44+ '''+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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.45'''- 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"."dashboard_id" = 99999+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999)+ LIMIT 21'''# ----# 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.46'''- 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)+ SELECT "ee_accesscontrol"."id",+ "ee_accesscontrol"."team_id",+ "ee_accesscontrol"."access_level",+ "ee_accesscontrol"."resource",+ "ee_accesscontrol"."resource_id",+ "ee_accesscontrol"."organization_member_id",+ "ee_accesscontrol"."role_id",+ "ee_accesscontrol"."created_by_id",+ "ee_accesscontrol"."created_at",+ "ee_accesscontrol"."updated_at"+ FROM "ee_accesscontrol"+ LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")+ WHERE (("ee_accesscontrol"."organization_member_id" IS NULL+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_id" = 99999)+ OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid+ AND "posthog_organizationmembership"."user_id" = 99999+ AND "ee_accesscontrol"."role_id" IS NULL+ AND "ee_accesscontrol"."team_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.47'''- SELECT "posthog_organization"."id",+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -8967,12 +10209,179 @@"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+ FROM "posthog_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.48+ '''+ 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.49+ '''+ SELECT "ee_role"."organization_id" AS "role__organization_id",+ "ee_rolemembership"."role_id" AS "role_id"+ FROM "ee_rolemembership"+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")+ WHERE "ee_rolemembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.5+ '''+ SELECT "posthog_organizationmembership"."id",+ "posthog_organizationmembership"."organization_id",+ "posthog_organizationmembership"."user_id",+ "posthog_organizationmembership"."level",+ "posthog_organizationmembership"."joined_at",+ "posthog_organizationmembership"."updated_at",+ "posthog_organizationmembership"."invited_by_id",+ "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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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_organizationmembership"+ INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")+ WHERE "posthog_organizationmembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.50+ '''+ SELECT "posthog_dashboard"."id" AS "id"+ 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 "posthog_dashboard"."id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.51+ '''+ SELECT "posthog_dashboard"."id" AS "id",+ "posthog_dashboard"."name" AS "name"+ 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.44+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.52+ '''+ 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"."deleted"+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.53+ '''+ 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"."deleted"+ AND "posthog_dashboardtile"."deleted" IS NOT NULL))+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.54+ '''+ 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.55'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -9068,62 +10477,15 @@"posthog_team"."experiment_recalculation_time","posthog_team"."default_experiment_confidence_level","posthog_team"."default_experiment_stats_method",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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"+ "posthog_team"."business_model"FROM "posthog_team"- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")WHERE "posthog_team"."id" = 99999LIMIT 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.56'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",+ SELECT "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -9162,46 +10524,128 @@"posthog_organization"."personalization","posthog_organization"."domain_whitelist","posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuidLIMIT 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.57'''- SELECT "ee_accesscontrol"."id",- "ee_accesscontrol"."team_id",- "ee_accesscontrol"."access_level",- "ee_accesscontrol"."resource",- "ee_accesscontrol"."resource_id",- "ee_accesscontrol"."organization_member_id",- "ee_accesscontrol"."role_id",- "ee_accesscontrol"."created_by_id",- "ee_accesscontrol"."created_at",- "ee_accesscontrol"."updated_at"- FROM "ee_accesscontrol"- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))+ 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.47+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.58'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.59+ '''+ SELECT "posthog_organization"."id","posthog_organization"."name","posthog_organization"."slug","posthog_organization"."logo_media_id",@@ -9240,12 +10684,12 @@"posthog_organization"."personalization","posthog_organization"."domain_whitelist","posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999+ 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.48+# 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",@@ -9258,161 +10702,19 @@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"- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")- WHERE "ee_rolemembership"."user_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.5- '''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.50- '''- SELECT "posthog_dashboard"."id" AS "id"- 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 "posthog_dashboard"."id" IN (1,- 2,- 3,- 4,- 5 /* ... */))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.51- '''- SELECT "posthog_dashboard"."id" AS "id",- "posthog_dashboard"."name" AS "name"- 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.52- '''- 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"."deleted"- AND "posthog_dashboardtile"."deleted" IS NOT NULL))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.53- '''- 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"."deleted"- 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.60'''- 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 /* ... */))+ 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.55+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.61'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -9514,7 +10816,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.62'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -9539,7 +10841,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# 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.63'''SELECT "posthog_insightviewed"."id","posthog_insightviewed"."team_id",@@ -9555,7 +10857,7 @@UPDATE'''# ----# 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.64'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -9601,7 +10903,7 @@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.65'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -9703,20 +11005,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.66'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -9743,7 +11032,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# 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.67'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -9770,7 +11059,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# 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.68'''SELECT "posthog_insightvariable"."id","posthog_insightvariable"."name",@@ -9790,7 +11079,7 @@ORDER BY "posthog_insightvariable"."name" ASC'''# ----# 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.69'''SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"FROM "posthog_dashboardtile"@@ -9801,7 +11090,16 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# 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.7+ '''+ SELECT "ee_role"."organization_id" AS "role__organization_id",+ "ee_rolemembership"."role_id" AS "role_id"+ FROM "ee_rolemembership"+ INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")+ WHERE "ee_rolemembership"."user_id" = 99999+ '''+# ---+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.70'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -9834,7 +11132,7 @@5 /* ... */))'''# ----# 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.71'''SELECT "posthog_tag"."name" AS "tag__name"FROM "posthog_taggeditem"@@ -9842,7 +11140,7 @@WHERE "posthog_taggeditem"."insight_id" = 99999'''# ----# 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.72'''SELECT "posthog_user"."id","posthog_user"."password",@@ -9888,7 +11186,7 @@AND "posthog_user"."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.73'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -9934,7 +11232,7 @@LIMIT 21'''# ----# 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.74'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -10076,7 +11374,7 @@LIMIT 21'''# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.69+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.75'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -10131,16 +11429,7 @@LIMIT 21'''# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.7- '''- SELECT "ee_role"."organization_id" AS "role__organization_id",- "ee_rolemembership"."role_id" AS "role_id"- FROM "ee_rolemembership"- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")- WHERE "ee_rolemembership"."user_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.70+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.76'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -10163,7 +11452,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# 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.77'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -10216,7 +11505,7 @@WHERE "posthog_organizationmembership"."user_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 "ee_accesscontrol"."team_id" AS "team_id","ee_accesscontrol"."resource_id" AS "resource_id",@@ -10229,7 +11518,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.73+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.79'''SELECT "ee_role"."organization_id" AS "role__organization_id","ee_rolemembership"."role_id" AS "role_id"@@ -10238,7 +11527,23 @@WHERE "ee_rolemembership"."user_id" = 99999'''# ----# 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_dashboard"."id" AS "id"FROM "posthog_dashboard"@@ -10258,7 +11563,7 @@5 /* ... */))'''# ----# 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_dashboard"."id" AS "id","posthog_dashboard"."name" AS "name"@@ -10271,7 +11576,7 @@5 /* ... */))'''# ----# 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 COUNT(*) AS "__count"FROM "posthog_dashboardtile"@@ -10284,7 +11589,7 @@AND "posthog_dashboardtile"."deleted" IS NOT NULL))'''# ----# 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_dashboard"."id","posthog_dashboard"."name",@@ -10317,7 +11622,7 @@5 /* ... */))'''# ----# 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 "posthog_team"."id","posthog_team"."uuid",@@ -10419,64 +11724,7 @@LIMIT 21'''# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.79- '''- 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.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_insightviewed"."id",- "posthog_insightviewed"."team_id",- "posthog_insightviewed"."user_id",- "posthog_insightviewed"."insight_id",- "posthog_insightviewed"."last_viewed_at"- 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.81+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.85'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -10522,7 +11770,19 @@LIMIT 21'''# ----# 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.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'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -10554,246 +11814,115 @@"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"."experiment_recalculation_time",- "posthog_team"."default_experiment_confidence_level",- "posthog_team"."default_experiment_stats_method",- "posthog_team"."business_model"- FROM "posthog_team"- WHERE "posthog_team"."id" = 99999- LIMIT 21- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.83- '''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted"- 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.84- '''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."text_id",- "posthog_dashboardtile"."button_tile_id",- "posthog_dashboardtile"."widget_id",- "posthog_dashboardtile"."team_id",- "posthog_dashboardtile"."layouts",- "posthog_dashboardtile"."color",- "posthog_dashboardtile"."filters_hash",- "posthog_dashboardtile"."last_refresh",- "posthog_dashboardtile"."refreshing",- "posthog_dashboardtile"."refresh_attempt",- "posthog_dashboardtile"."filters_overrides",- "posthog_dashboardtile"."show_description",- "posthog_dashboardtile"."transparent_background",- "posthog_dashboardtile"."deleted"- 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.85- '''- 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.86- '''- 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.87- '''- 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 /* ... */))+ "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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21'''# ---# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.88'''- 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"."insight_id" = 99999+ 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.89'''- 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)+ SELECT "posthog_insightviewed"."id",+ "posthog_insightviewed"."team_id",+ "posthog_insightviewed"."user_id",+ "posthog_insightviewed"."insight_id",+ "posthog_insightviewed"."last_viewed_at"+ 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.9@@ -11040,140 +12169,187 @@"posthog_team"."experiment_recalculation_time","posthog_team"."default_experiment_confidence_level","posthog_team"."default_experiment_stats_method",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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"+ "posthog_team"."business_model"FROM "posthog_team"- INNER JOIN "posthog_organization" ON ("posthog_team"."organization_id" = "posthog_organization"."id")WHERE "posthog_team"."id" = 99999LIMIT 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.92+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted"+ 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.93+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."text_id",+ "posthog_dashboardtile"."button_tile_id",+ "posthog_dashboardtile"."widget_id",+ "posthog_dashboardtile"."team_id",+ "posthog_dashboardtile"."layouts",+ "posthog_dashboardtile"."color",+ "posthog_dashboardtile"."filters_hash",+ "posthog_dashboardtile"."last_refresh",+ "posthog_dashboardtile"."refreshing",+ "posthog_dashboardtile"."refresh_attempt",+ "posthog_dashboardtile"."filters_overrides",+ "posthog_dashboardtile"."show_description",+ "posthog_dashboardtile"."transparent_background",+ "posthog_dashboardtile"."deleted"+ 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.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_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "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"."allow_publicly_shared_resources",- "posthog_organization"."read_only_mcp_access",- "posthog_organization"."default_role_id",- "posthog_organization"."plugins_access_level",- "posthog_organization"."for_internal_metrics",- "posthog_organization"."default_experiment_stats_method",- "posthog_organization"."default_anonymize_ips",- "posthog_organization"."is_hipaa",- "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_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999)- LIMIT 21+ 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.93+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.96'''- SELECT "ee_accesscontrol"."id",- "ee_accesscontrol"."team_id",- "ee_accesscontrol"."access_level",- "ee_accesscontrol"."resource",- "ee_accesscontrol"."resource_id",- "ee_accesscontrol"."organization_member_id",- "ee_accesscontrol"."role_id",- "ee_accesscontrol"."created_by_id",- "ee_accesscontrol"."created_at",- "ee_accesscontrol"."updated_at"- FROM "ee_accesscontrol"- LEFT OUTER JOIN "posthog_organizationmembership" ON ("ee_accesscontrol"."organization_member_id" = "posthog_organizationmembership"."id")- WHERE (("ee_accesscontrol"."organization_member_id" IS NULL- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999)- OR ("posthog_organizationmembership"."organization_id" = '00000000-0000-0000-0000-000000000000'::uuid- AND "posthog_organizationmembership"."user_id" = 99999- AND "ee_accesscontrol"."role_id" IS NULL- AND "ee_accesscontrol"."team_id" = 99999))+ 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.94+# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.97'''- SELECT "posthog_organizationmembership"."id",- "posthog_organizationmembership"."organization_id",- "posthog_organizationmembership"."user_id",- "posthog_organizationmembership"."level",- "posthog_organizationmembership"."joined_at",- "posthog_organizationmembership"."updated_at",- "posthog_organizationmembership"."invited_by_id",- "posthog_organization"."id",+ 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"."insight_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",@@ -11212,77 +12388,9 @@"posthog_organization"."personalization","posthog_organization"."domain_whitelist","posthog_organization"."is_platform"- FROM "posthog_organizationmembership"- INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id")- WHERE "posthog_organizationmembership"."user_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.95- '''- 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.96- '''- SELECT "ee_role"."organization_id" AS "role__organization_id",- "ee_rolemembership"."role_id" AS "role_id"- FROM "ee_rolemembership"- INNER JOIN "ee_role" ON ("ee_rolemembership"."role_id" = "ee_role"."id")- WHERE "ee_rolemembership"."user_id" = 99999- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.97- '''- SELECT "posthog_dashboard"."id" AS "id"- 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 "posthog_dashboard"."id" IN (1,- 2,- 3,- 4,- 5 /* ... */))- '''-# ----# name: TestDashboard.test_loading_individual_dashboard_does_not_prefetch_all_possible_tiles.98- '''- SELECT "posthog_dashboard"."id" AS "id",- "posthog_dashboard"."name" AS "name"- 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.99- '''- 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"."deleted"- AND "posthog_dashboardtile"."deleted" IS NOT NULL))+ FROM "posthog_organization"+ WHERE "posthog_organization"."id" = '00000000-0000-0000-0000-000000000000'::uuid+ LIMIT 21'''# ---# name: TestDashboard.test_retrieve_dashboarddiff --git a/posthog/api/test/dashboards/test_dashboard.py b/posthog/api/test/dashboards/test_dashboard.pyindex 9b3ebdf00e81..9fdf582ace49 100644--- a/posthog/api/test/dashboards/test_dashboard.py+++ b/posthog/api/test/dashboards/test_dashboard.py@@ -14,7 +14,7 @@ from dateutil.parser import isoparsefrom parameterized import parameterizedfrom rest_framework import status-from posthog.schema import DateRange, EventPropertyFilter, EventsNode, PropertyOperator, TrendsQuery+from posthog.schema import DateRange, EventPropertyFilter, EventsNode, InsightVizNode, PropertyOperator, TrendsQueryfrom posthog.hogql.errors import ExposedHogQLError@@ -956,11 +956,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):def test_adding_insights_is_not_nplus1_for_gets(self):with mute_selected_signals():dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard"})- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }baseline = 9# Each dashboard GET that materializes at least one insight runner performs one@@ -973,15 +968,15 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})# baseline + 11 + 9 once at least one insight materializes- self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_id]})+ self.dashboard_api.create_insight({"dashboards": [dashboard_id]})with self.assertNumQueries(baseline + 11 + 9):self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})- self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_id]})+ self.dashboard_api.create_insight({"dashboards": [dashboard_id]})with self.assertNumQueries(baseline + 11 + 9):self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})- self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_id]})+ self.dashboard_api.create_insight({"dashboards": [dashboard_id]})with self.assertNumQueries(baseline + 11 + 9):self.dashboard_api.get_dashboard(dashboard_id, query_params={"no_items_field": "true"})@@ -1221,7 +1216,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):dashboard_id, _ = self.dashboard_api.create_dashboard({"filters": {"date_from": "-14d"}})insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test", "date_from": "-7d"},"dashboards": [dashboard_id],"name": "some_item",}@@ -1359,7 +1353,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):dashboard_id, _ = self.dashboard_api.create_dashboard({"filters": {"date_from": "-14d"}})insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test", "date_from": "-7d"},+ "query": InsightVizNode(+ source=TrendsQuery(series=[EventsNode(event="$pageview")], dateRange=DateRange(date_from="-7d"))+ ).model_dump(),"dashboards": [dashboard_id],"name": "some_item",}@@ -1389,14 +1385,12 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):dashboard_id, _ = self.dashboard_api.create_dashboard({"filters": {"date_from": "-14d"}})insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test", "date_from": "-7d"},"dashboards": [dashboard_id],"name": "some_item",})out_of_synch_insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test", "date_from": "-7d"},"dashboards": [dashboard_id],"name": "out of synch",}@@ -1444,9 +1438,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):through to CREATE with only {id, dashboard, deleted} fields set."""dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "d"})- insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"hello": "test"}, "dashboards": [dashboard_id], "name": "i"}- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": "i"})tile = DashboardTile.objects.get(insight_id=insight_id, dashboard_id=dashboard_id)self.dashboard_api.soft_delete(insight_id, "insights")@@ -1479,28 +1471,22 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):with_layout_insight_ids: list[int] = []for i in range(5):insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"hello": f"test-{i}"}, "dashboards": [dashboard_id], "name": f"with-layout-{i}"}+ {"dashboards": [dashboard_id], "name": f"with-layout-{i}"})with_layout_insight_ids.append(insight_id)# 3 alive insight tiles whose layouts stay {} (creation default).for i in range(3):- self.dashboard_api.create_insight(- {"filters": {"hello": f"empty-{i}"}, "dashboards": [dashboard_id], "name": f"empty-layout-{i}"}- )+ self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": f"empty-layout-{i}"})# 2 tiles whose insight gets soft-deleted -> tile cascades to deleted=Truefor i in range(2):- insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"hello": f"cascade-{i}"}, "dashboards": [dashboard_id], "name": f"cascade-{i}"}- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": f"cascade-{i}"})self.dashboard_api.soft_delete(insight_id, "insights")# 2 tiles soft-deleted directly via PATCH (insight stays alive)for i in range(2):- insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"hello": f"direct-{i}"}, "dashboards": [dashboard_id], "name": f"direct-{i}"}- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": f"direct-{i}"})tile_to_remove = DashboardTile.objects.get(insight_id=insight_id, dashboard_id=dashboard_id)self.dashboard_api.update_dashboard(dashboard_id, {"tiles": [{"id": tile_to_remove.id, "deleted": True}]})@@ -1598,9 +1584,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):In both cases the bad id must be silently skipped while the rest of the payload saves."""dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "target"})- valid_insight, _ = self.dashboard_api.create_insight(- {"filters": {"hello": "valid"}, "dashboards": [dashboard_id], "name": "valid"}- )+ valid_insight, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": "valid"})valid_tile = DashboardTile.objects.get(insight_id=valid_insight, dashboard_id=dashboard_id)stranger_tile: DashboardTile | None = None@@ -1609,7 +1593,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):if scenario == "tile_belongs_to_another_dashboard":other_dashboard, _ = self.dashboard_api.create_dashboard({"name": "other"})stranger_insight, _ = self.dashboard_api.create_insight(- {"filters": {"hello": "stranger"}, "dashboards": [other_dashboard], "name": "stranger"}+ {"dashboards": [other_dashboard], "name": "stranger"})stranger_tile = DashboardTile.objects.get(insight_id=stranger_insight, dashboard_id=other_dashboard)unknown_tile_id = stranger_tile.id@@ -1649,7 +1633,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):dashboard_id, _ = self.dashboard_api.create_dashboard({"filters": {"date_from": "-14d"}})insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test", "date_from": "-7d"},+ "query": InsightVizNode(+ source=TrendsQuery(series=[EventsNode(event="$pageview")], dateRange=DateRange(date_from="-7d"))+ ).model_dump(),"dashboards": [dashboard_id],"name": "some_item",}@@ -1678,7 +1664,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test", "date_from": "-7d"},+ "query": InsightVizNode(+ source=TrendsQuery(series=[EventsNode(event="$pageview")], dateRange=DateRange(date_from="-7d"))+ ).model_dump(),"dashboards": [dashboard_id],"name": "some_item",}@@ -1717,7 +1705,12 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):def test_dashboard_filter_is_applied_even_if_insight_is_created_before_dashboard(self):insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"hello": "test", "date_from": "-7d"}, "name": "some_item"}+ {+ "name": "some_item",+ "query": InsightVizNode(+ source=TrendsQuery(series=[EventsNode(event="$pageview")], dateRange=DateRange(date_from="-7d"))+ ).model_dump(),+ })dashboard_id, _ = self.dashboard_api.create_dashboard({"filters": {"date_from": "-14d"}})@@ -1737,7 +1730,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):Insight.objects.create(filters={"hello": "test"}, team=self.team, created_by=test_user)- self.dashboard_api.create_insight({"filters": {"hello": "test"}})+ self.dashboard_api.create_insight({})response = self.client.get(f"/api/projects/{self.team.id}/insights/?user=true").json()self.assertEqual(response["count"], 1)@@ -1747,7 +1740,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test"},"dashboards": [dashboard_id],"name": "another",}@@ -1770,7 +1762,6 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):insight_id, _ = self.dashboard_api.create_insight({- "filters": {"hello": "test"},"dashboards": [dashboard_id],"name": "another",}@@ -1806,9 +1797,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):def test_dashboard_tile_show_description_can_be_toggled(self):dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "test", "pinned": True})- self.dashboard_api.create_insight(- {"filters": {"hello": "test"}, "dashboards": [dashboard_id], "name": "insight"}- )+ self.dashboard_api.create_insight({"dashboards": [dashboard_id], "name": "insight"})dashboard_json = self.dashboard_api.get_dashboard(dashboard_id)tile_id = dashboard_json["tiles"][0]["id"]@@ -2094,6 +2083,24 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):original_text_tile = next(t for t in dashboard_with_tiles["tiles"] if t.get("text"))assert text_tile["text"]["id"] != original_text_tile["text"]["id"]+ def test_dashboard_duplication_reports_a_tile_it_cannot_copy(self) -> None:+ existing_dashboard = Dashboard.objects.create(team=self.team, name="existing dashboard", created_by=self.user)+ # A name already at the column limit no longer fits once duplication appends " (Copy)",+ # so the copy fails validation. Any tile that fails it used to reach save() on an invalid+ # serializer and return a 500 naming nothing.+ self.dashboard_api.create_insight({"dashboards": [existing_dashboard.pk], "name": "n" * 400})++ _, response = self.dashboard_api.create_dashboard(+ {+ "name": "another",+ "use_dashboard": existing_dashboard.id,+ "duplicate_tiles": True,+ },+ expected_status=status.HTTP_400_BAD_REQUEST,+ )++ assert "Can't copy the insight" in response["detail"]+@parameterized.expand([("with_layouts", {"sm": {"x": 6, "y": 0, "w": 6, "h": 5}}, {"sm": {"x": 6, "y": 0, "w": 6, "h": 5}}),@@ -2487,14 +2494,8 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):self.assertEqual(dashboard["tiles"], [])def test_can_soft_delete_insight_after_soft_deleting_dashboard(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard"})- insight_id, _ = self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_id]})+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id]})self.dashboard_api.soft_delete(dashboard_id, "dashboards")@@ -2504,14 +2505,8 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):self.dashboard_api.soft_delete(insight_id, "insights")def test_can_soft_delete_dashboard_after_soft_deleting_insight(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard"})- insight_id, _ = self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_id]})+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id]})self.dashboard_api.soft_delete(insight_id, "insights")@@ -2560,15 +2555,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):assert insight_two_json["deleted"] is Falsedef test_can_copy_tile_between_dashboards(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_one_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard one"})dashboard_two_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard two"})- insight_id, _ = self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_one_id]})+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_one_id]})dashboard_one = self.dashboard_api.get_dashboard(dashboard_one_id)assert len(dashboard_one["tiles"]) == 1@@ -2590,17 +2579,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):assert dashboard_two["tiles"][0]["insight"]["id"] == insight_iddef test_copy_tile_rejects_when_insight_already_on_destination(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_one_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard one"})dashboard_two_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard two"})- _, _ = self.dashboard_api.create_insight(- {"filters": filter_dict, "dashboards": [dashboard_one_id, dashboard_two_id]}- )+ _, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_one_id, dashboard_two_id]})dashboard_one = self.dashboard_api.get_dashboard(dashboard_one_id)tile_id = dashboard_one["tiles"][0]["id"]@@ -2639,17 +2620,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):assert "already" in json.dumps(response2.json()).lower()def test_copy_tile_restores_soft_deleted_insight_tile_on_destination(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_a_id, _ = self.dashboard_api.create_dashboard({"name": "a"})dashboard_b_id, _ = self.dashboard_api.create_dashboard({"name": "b"})- insight_id, _ = self.dashboard_api.create_insight(- {"filters": filter_dict, "dashboards": [dashboard_a_id, dashboard_b_id]}- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_a_id, dashboard_b_id]})self.dashboard_api.update_insight(insight_id, {"dashboards": [dashboard_a_id]})@@ -2668,15 +2641,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):assert dashboard_b["tiles"][0]["insight"]["id"] == insight_iddef test_can_move_tile_between_dashboards(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_one_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard one"})dashboard_two_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard two"})- insight_id, _ = self.dashboard_api.create_insight({"filters": filter_dict, "dashboards": [dashboard_one_id]})+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_one_id]})dashboard_one = self.dashboard_api.get_dashboard(dashboard_one_id)assert len(dashboard_one["tiles"]) == 1@@ -2724,9 +2691,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):other_dashboard = Dashboard.objects.create(team=other_team, name="other dashboard")dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "my dashboard"})- self.dashboard_api.create_insight(- {"filters": {"events": [{"id": "$pageview"}], "insight": "TRENDS"}, "dashboards": [dashboard_id]}- )+ self.dashboard_api.create_insight({"dashboards": [dashboard_id]})dashboard = self.dashboard_api.get_dashboard(dashboard_id)tile = dashboard["tiles"][0]@@ -2751,9 +2716,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):dashboard_one_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard one"})dashboard_two_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard two"})- self.dashboard_api.create_insight(- {"filters": {"events": [{"id": "$pageview"}], "insight": "TRENDS"}, "dashboards": [dashboard_one_id]}- )+ self.dashboard_api.create_insight({"dashboards": [dashboard_one_id]})dashboard_one = self.dashboard_api.get_dashboard(dashboard_one_id)tile = dashboard_one["tiles"][0]@@ -2793,9 +2756,7 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):other_insight = Insight.objects.create(team=other_team, name="secret insight")dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "my dashboard"})- insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"events": [{"id": "$pageview"}]}, "dashboards": [dashboard_id]}- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id]})dashboard_json = self.dashboard_api.get_dashboard(dashboard_id)tile_id = dashboard_json["tiles"][0]["id"]@@ -2863,17 +2824,9 @@ class TestDashboard(APIBaseTest, QueryMatchingTest):assert btn.text == "original"def test_relations_on_insights_when_dashboards_were_deleted(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "insight": "TRENDS",- }-dashboard_one_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard one"})dashboard_two_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard two"})- insight_id, _ = self.dashboard_api.create_insight(- {"filters": filter_dict, "dashboards": [dashboard_one_id, dashboard_two_id]}- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_one_id, dashboard_two_id]})self.dashboard_api.soft_delete(dashboard_one_id, "dashboards")diff --git a/posthog/api/test/test_activity_log.py b/posthog/api/test/test_activity_log.pyindex 92f7cb28bdc2..447422670209 100644--- a/posthog/api/test/test_activity_log.py+++ b/posthog/api/test/test_activity_log.py@@ -17,6 +17,7 @@ from posthog.models import Organization, OrganizationMembership, PersonalAPIKey,from posthog.models.activity_logging.activity_log import ActivityLog, Detail, log_activityfrom posthog.models.oauth import OAuthAccessToken, OAuthApplicationfrom posthog.models.utils import generate_random_token_personal, hash_key_value+from posthog.test.insight_queries import default_pageview_queryfrom products.exports.backend.models.exported_asset import ExportedAsset@@ -71,8 +72,8 @@ class TestActivityLog(APIBaseTest, QueryMatchingTest):if team_id is None:team_id = self.team.id- if "filters" not in data:- data["filters"] = {"events": [{"id": "$pageview"}]}+ if "query" not in data:+ data["query"] = default_pageview_query()response = self.client.post(f"/api/projects/{team_id}/insights", data=data)self.assertEqual(response.status_code, expected_status)diff --git a/posthog/api/test/test_my_notifications.py b/posthog/api/test/test_my_notifications.pyindex c3cab402c87b..26d88770957e 100644--- a/posthog/api/test/test_my_notifications.py+++ b/posthog/api/test/test_my_notifications.py@@ -8,6 +8,7 @@ from posthog.test.base import APIBaseTest, FuzzyInt, QueryMatchingTestfrom rest_framework import statusfrom posthog.models import NotificationViewed, User+from posthog.test.insight_queries import default_pageview_querydef _feature_flag_json_payload(key: str) -> dict:@@ -60,8 +61,8 @@ class TestMyNotifications(APIBaseTest, QueryMatchingTest):if team_id is None:team_id = self.team.id- if "filters" not in data:- data["filters"] = {"events": [{"id": "$pageview"}]}+ if "query" not in data:+ data["query"] = default_pageview_query()response = self.client.post(f"/api/projects/{team_id}/insights", data=data)self.assertEqual(response.status_code, expected_status)diff --git a/posthog/tasks/alerts/test/test_alert_evaluation.py b/posthog/tasks/alerts/test/test_alert_evaluation.pyindex 81186a7b3b09..e11b141108c0 100644--- a/posthog/tasks/alerts/test/test_alert_evaluation.py+++ b/posthog/tasks/alerts/test/test_alert_evaluation.py@@ -11,6 +11,7 @@ from posthog.models.instance_setting import set_instance_settingfrom posthog.tasks.alerts.test.alert_check_helpers import run_alert_checkfrom products.alerts.backend.models import AlertCheck, AlertConfiguration+from products.product_analytics.backend.facade.models import Insight@freeze_time("2024-06-02T08:55:00.000Z")@@ -89,11 +90,14 @@ class TestAlertEvaluation(APIBaseTest, ClickhouseDestroyTablesMixin):def test_alert_with_insight_with_filter(self, mock_send_notifications_for_breaches: MagicMock, mock_send_errors: MagicMock) -> None:- insight = self.dashboard_api.create_insight(- data={"name": "insight", "filters": {"events": [{"id": "$pageview"}], "display": "BoldNumber"}}- )[1]+ # An alert still runs on an insight stored as filters, and only the ORM writes one now.+ insight = Insight.objects.create(+ team=self.team,+ name="insight",+ filters={"events": [{"id": "$pageview"}], "display": "BoldNumber"},+ )- self.client.patch(f"/api/projects/{self.team.id}/alerts/{self.alert['id']}", data={"insight": insight["id"]})+ self.client.patch(f"/api/projects/{self.team.id}/alerts/{self.alert['id']}", data={"insight": insight.id})self.set_thresholds(lower=1)run_alert_check(self.alert["id"])diff --git a/posthog/test/activity_log_utils.py b/posthog/test/activity_log_utils.pyindex b47636888748..92ce4b15da30 100644--- a/posthog/test/activity_log_utils.py+++ b/posthog/test/activity_log_utils.py@@ -12,6 +12,8 @@ from django.utils import timezonefrom rest_framework import status+from posthog.test.insight_queries import default_pageview_query+from ee.api.test.base import APILicensedTestif TYPE_CHECKING:@@ -125,7 +127,7 @@ class ActivityLogTestHelper(APILicensedTest):"""Create an insight via API."""data = {"name": name,- "filters": {"events": [{"id": "$pageview"}], "display": "ActionsLineGraph"},+ "query": default_pageview_query(),"description": "Test insight description",**kwargs,}diff --git a/posthog/test/base.py b/posthog/test/base.pyindex 9a808fcfddfb..8ebbf8170f81 100644--- a/posthog/test/base.py+++ b/posthog/test/base.py@@ -488,6 +488,14 @@ def clean_varying_query_parts(query, replace_all_numbers):query,)+ # the sharing publish gate checks a share against now()+ # e.g. AND "posthog_sharingconfiguration"."expires_at" > '2024-01-01 12:00:00+00:00'::timestamptz+ query = re.sub(+ r"\"posthog_sharingconfiguration\"\.\"expires_at\" > '[^']+'::timestamptz",+ '"posthog_sharingconfiguration"."expires_at" > \'SHARING-EXPIRY-TIMESTAMP\'::timestamptz',+ query,+ )+# replace Savepoint numbersquery = re.sub(r"SAVEPOINT \".+\"", "SAVEPOINT _snapshot_", query)diff --git a/posthog/test/insight_queries.py b/posthog/test/insight_queries.pynew file mode 100644index 000000000000..81264802368d--- /dev/null+++ b/posthog/test/insight_queries.py@@ -0,0 +1,31 @@+"""Build the `query` payloads that tests send when they write an insight.++The insights API only stores a definition sent as a query, so a test that wants an insight with a+given definition writes that query itself.+"""++from typing import Any++from posthog.schema_migrations.upgrade import upgrade+++def insight_query(source: dict[str, Any]) -> dict[str, Any]:+ """Wrap a query source in the node an insight stores, at the current schema version.++ `source` only needs the fields the test reads. The version has to be current: a stored query one+ version behind is upgraded on read, so the next write logs a query change the caller never made.+ """+ return upgrade({"kind": "InsightVizNode", "source": source, "full": True})+++def default_pageview_query() -> dict[str, Any]:+ # The shape the frontend writes for a fresh trends insight (`getTrendsQueryDefault`): a series, an+ # empty `trendsFilter`, and no breakdown. `trendsFilter: {}` is not the same query as no+ # `trendsFilter` at all, which resolves to null.+ return insight_query(+ {+ "kind": "TrendsQuery",+ "series": [{"kind": "EventsNode", "event": "$pageview", "name": "$pageview", "math": "total"}],+ "trendsFilter": {},+ }+ )diff --git a/products/dashboards/backend/api/dashboard.py b/products/dashboards/backend/api/dashboard.pyindex 8a8d29767670..2242ef59f340 100644--- a/products/dashboards/backend/api/dashboard.py+++ b/products/dashboards/backend/api/dashboard.py@@ -1679,7 +1679,18 @@ class DashboardSerializer(DashboardMetadataSerializer):new_data.pop("dashboards", None)new_tags = new_data.pop("tags", None)insight_serializer = InsightSerializer(data=new_data, context=self.context)- insight_serializer.is_valid()+ if not insight_serializer.is_valid():+ # `save()` on an invalid serializer is a 500 that names no tile. The copy fails+ # whenever it inherits something invalid, such as a name that " (Copy)" pushes+ # past the column limit, or a definition the insight write rules reject.+ source = existing_tile.insight+ reasons = "; ".join(+ f"{field}: {' '.join(str(message) for message in messages)}"+ for field, messages in insight_serializer.errors.items()+ )+ raise exceptions.ValidationError(+ f'Can\'t copy the insight "{source.name or source.derived_name or source.short_id}". {reasons}'+ )insight_serializer.save()insight = cast(Insight, insight_serializer.instance)diff --git a/products/model_crossing_uses_baseline.txt b/products/model_crossing_uses_baseline.txtindex d3182b735af8..52d09bc7f1df 100644--- a/products/model_crossing_uses_baseline.txt+++ b/products/model_crossing_uses_baseline.txt@@ -829,7 +829,7 @@ warehouse_sources.WarehouseColumnAnnotation products.data_warehouse.backend.preswarehouse_sources.WarehouseColumnAnnotation products.posthog_ai.evals.data_warehouse.seeder construct 2warehouse_sources.WarehouseColumnAnnotation products.posthog_ai.evals.data_warehouse.seeder write(bulk_create) 1web_analytics:backend/hogql_queries/ ee.clickhouse.views.test.test_experiment_saved_metrics drives(TrendsQuery) 2-web_analytics:backend/hogql_queries/ posthog.api.test.dashboards.test_dashboard drives(TrendsQuery) 5+web_analytics:backend/hogql_queries/ posthog.api.test.dashboards.test_dashboard drives(TrendsQuery) 6web_analytics:backend/hogql_queries/ posthog.api.test.test_alert_15_minute_interval drives(TrendsQuery) 1web_analytics:backend/hogql_queries/ posthog.api.test.test_alert_real_time_interval drives(TrendsQuery) 1web_analytics:backend/hogql_queries/ posthog.hogql.database.schema.test.test_persons drives(TrendsQuery) 1@@ -877,7 +877,7 @@ web_analytics:backend/hogql_queries/ products.endpoints.backend.tests.test_variaweb_analytics:backend/hogql_queries/ products.experiments.backend.test.test_presentation_api drives(TrendsQuery) 1web_analytics:backend/hogql_queries/ products.feature_flags.backend.api.test.test_feature_flag drives(TrendsQuery) 6web_analytics:backend/hogql_queries/ products.posthog_ai.scripts.hogql_example.test.test_hogql_example drives(TrendsQuery) 3-web_analytics:backend/hogql_queries/ products.product_analytics.backend.tests.api.test_insight drives(TrendsQuery) 19+web_analytics:backend/hogql_queries/ products.product_analytics.backend.tests.api.test_insight drives(TrendsQuery) 21web_analytics:backend/hogql_queries/ products.product_analytics.backend.tests.api.test_insight_metadata drives(TrendsQuery) 5web_analytics:backend/hogql_queries/ products.product_analytics.backend.tests.api.test_insight_query drives(TrendsQuery) 4web_analytics:backend/hogql_queries/ products.product_analytics.backend.tests.api.test_paths_v2 drives(TrendsQuery) 1diff --git a/products/product_analytics/backend/models/insight.py b/products/product_analytics/backend/models/insight.pyindex 196e887e3963..5780a35f0c1b 100644--- a/products/product_analytics/backend/models/insight.py+++ b/products/product_analytics/backend/models/insight.py@@ -128,7 +128,7 @@ class Insight(RootTeamMixin, FileSystemSyncMixin, models.Model):)# Changing these fields materially alters the Insight, so these count for the "last_modified_*" fields- MATERIAL_INSIGHT_FIELDS = {"name", "description", "filters"}+ MATERIAL_INSIGHT_FIELDS = {"name", "description", "query"}__repr__ = sane_repr("team_id", "id", "short_id", "name")diff --git a/products/product_analytics/backend/presentation/insight.py b/products/product_analytics/backend/presentation/insight.pyindex 8e431e68884d..ddfc200bf14e 100644--- a/products/product_analytics/backend/presentation/insight.py+++ b/products/product_analytics/backend/presentation/insight.py@@ -196,7 +196,6 @@ logger = structlog.get_logger(__name__)tracer = trace.get_tracer(__name__)LEGACY_INSIGHT_ENDPOINTS_BLOCKED_FLAG = "legacy-insight-endpoints-disabled"-LEGACY_INSIGHT_FILTERS_BLOCKED_FLAG = "legacy-insight-filters-disabled"EXPORT_QUERY_CACHE_MISS = Counter(@@ -281,26 +280,6 @@ def is_legacy_insight_endpoint_blocked(user: Any, team: Team) -> bool:)-def is_legacy_insight_filters_blocked(user: Any, team: Team) -> bool:- distinct_id = getattr(user, "distinct_id", None)- if not distinct_id:- return False-- return feature_enabled_or_false(- LEGACY_INSIGHT_FILTERS_BLOCKED_FLAG,- str(distinct_id),- groups={- "organization": str(team.organization_id),- "project": str(team.id),- },- group_properties={- "organization": {"id": str(team.organization_id)},- "project": {"id": str(team.id)},- },- send_feature_flag_events=False,- )--def capture_legacy_api_call(request: request.Request, team: Team) -> None:if is_legacy_insight_endpoint_blocked(request.user, team):raise PermissionDenied("Legacy insight endpoints are not available for this user.")@@ -727,19 +706,34 @@ class InsightSerializer(InsightBasicSerializer):"timezone","refreshing","is_cached",+ # A read still serves the stored filters of an insight written before queries.+ "filters",)def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:query = attrs.get("query") if "query" in attrs else None- using_legacy_filters = "filters" in attrs and attrs.get("filters") is not None and query in (None, {})- if using_legacy_filters and is_legacy_insight_filters_blocked(- self.context["request"].user, self.context["get_team"]()- ):- raise PermissionDenied("Creating or updating insights with legacy filters is not available for this user.")+ # `filters` is read-only, so DRF drops it before validation. The raw payload is the only+ # place a legacy write still shows up, and it has to be answered rather than ignored.+ sent_filters = self.initial_data.get("filters")+ using_legacy_filters = sent_filters is not None and query in (None, {})+ if using_legacy_filters:+ # Opens with the sentence the deprecation notice told these callers to expect.+ raise PermissionDenied(+ "Creating or updating insights with legacy filters is not available for this user. "+ "Send a query object instead. See https://posthog.com/docs/api/insights"+ )++ if self.instance is None and query in (None, {}):+ raise ValidationError(+ {+ "query": "Creating an insight needs a query. See https://posthog.com/docs/api/insights",+ }+ )validate_insight_write(query=query,- filters=attrs.get("filters"),+ # No write reaches the stored filters, so only the query needs judging.+ filters=None,# A write that omits `query` keeps the stored one, which is still what renders.unchanged_query=None if "query" in attrs else getattr(self.instance, "query", None),team=self.context["get_team"](),diff --git a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambrindex 79edca68beb6..1d246bc4af58 100644--- a/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr+++ b/products/product_analytics/backend/tests/api/__snapshots__/test_insight.ambr@@ -604,6 +604,154 @@'''# ---# name: TestInsight.test_listing_insights_does_not_nplus1.11+ '''+ 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"."allow_publicly_shared_resources",+ "posthog_organization"."read_only_mcp_access",+ "posthog_organization"."default_role_id",+ "posthog_organization"."plugins_access_level",+ "posthog_organization"."for_internal_metrics",+ "posthog_organization"."default_experiment_stats_method",+ "posthog_organization"."default_anonymize_ips",+ "posthog_organization"."is_hipaa",+ "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: TestInsight.test_listing_insights_does_not_nplus1.12+ '''+ 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"."experiment_recalculation_time",+ "posthog_team"."default_experiment_confidence_level",+ "posthog_team"."default_experiment_stats_method",+ "posthog_team"."business_model"+ FROM "posthog_team"+ WHERE "posthog_team"."id" = 99999+ LIMIT 21+ '''+# ---+# name: TestInsight.test_listing_insights_does_not_nplus1.13'''SELECT "posthog_filesystem"."team_id","posthog_filesystem"."id",@@ -628,7 +776,7 @@AND "posthog_filesystem"."shortcut" IS NOT NULL))'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.12+# name: TestInsight.test_listing_insights_does_not_nplus1.14'''SELECT "posthog_insightviewed"."id","posthog_insightviewed"."team_id",@@ -644,7 +792,7 @@UPDATE'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.13+# name: TestInsight.test_listing_insights_does_not_nplus1.15'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -671,7 +819,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.14+# name: TestInsight.test_listing_insights_does_not_nplus1.16'''SELECT "posthog_dashboardtile"."id","posthog_dashboardtile"."dashboard_id",@@ -698,7 +846,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.15+# name: TestInsight.test_listing_insights_does_not_nplus1.17'''SELECT "posthog_insightvariable"."id","posthog_insightvariable"."name",@@ -718,7 +866,7 @@ORDER BY "posthog_insightvariable"."name" ASC'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.16+# name: TestInsight.test_listing_insights_does_not_nplus1.18'''SELECT "posthog_dashboardtile"."dashboard_id" AS "dashboard_id"FROM "posthog_dashboardtile"@@ -729,7 +877,7 @@AND "posthog_dashboardtile"."insight_id" = 99999)'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.17+# name: TestInsight.test_listing_insights_does_not_nplus1.19'''SELECT "posthog_dashboard"."id","posthog_dashboard"."name",@@ -762,21 +910,6 @@5 /* ... */))'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.18- '''- 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"."insight_id" = 99999- '''-# ----# name: TestInsight.test_listing_insights_does_not_nplus1.19- '''- SELECT COUNT(*) AS "__count"- FROM "posthog_dashboarditem"- WHERE NOT ("posthog_dashboarditem"."deleted")- '''-# ---# name: TestInsight.test_listing_insights_does_not_nplus1.2'''SELECT "posthog_team"."id",@@ -920,6 +1053,21 @@'''# ---# name: TestInsight.test_listing_insights_does_not_nplus1.20+ '''+ 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"."insight_id" = 99999+ '''+# ---+# name: TestInsight.test_listing_insights_does_not_nplus1.21+ '''+ SELECT COUNT(*) AS "__count"+ FROM "posthog_dashboarditem"+ WHERE NOT ("posthog_dashboarditem"."deleted")+ '''+# ---+# name: TestInsight.test_listing_insights_does_not_nplus1.22'''SELECT "posthog_user"."id","posthog_user"."password",@@ -965,7 +1113,7 @@AND "posthog_user"."id" = 99999)'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.21+# name: TestInsight.test_listing_insights_does_not_nplus1.23'''SELECT "posthog_organization"."id","posthog_organization"."name",@@ -1011,7 +1159,7 @@LIMIT 21'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.22+# name: TestInsight.test_listing_insights_does_not_nplus1.24'''SELECT "posthog_team"."id","posthog_team"."uuid",@@ -1153,7 +1301,7 @@LIMIT 21'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.23+# name: TestInsight.test_listing_insights_does_not_nplus1.25'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -1208,7 +1356,7 @@LIMIT 21'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.24+# name: TestInsight.test_listing_insights_does_not_nplus1.26'''SELECT "ee_accesscontrol"."id","ee_accesscontrol"."team_id",@@ -1231,7 +1379,7 @@AND "ee_accesscontrol"."team_id" = 99999))'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.25+# name: TestInsight.test_listing_insights_does_not_nplus1.27'''SELECT "posthog_organizationmembership"."id","posthog_organizationmembership"."organization_id",@@ -1284,7 +1432,7 @@WHERE "posthog_organizationmembership"."user_id" = 99999'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.26+# name: TestInsight.test_listing_insights_does_not_nplus1.28'''SELECT COUNT(*) AS "__count"FROM "posthog_dashboarditem"@@ -1293,7 +1441,7 @@AND NOT ("posthog_dashboarditem"."deleted"))'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.27+# name: TestInsight.test_listing_insights_does_not_nplus1.29'''SELECT "posthog_dashboarditem"."id","posthog_dashboarditem"."name",@@ -1482,48 +1630,6 @@LIMIT 100'''# ----# name: TestInsight.test_listing_insights_does_not_nplus1.28- '''- SELECT "posthog_dashboardtile"."id",- "posthog_dashboardtile"."dashboard_id",- "posthog_dashboardtile"."insight_id",- "posthog_dashboardtile"."deleted"- 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" IN (1,- 2,- 3,- 4,- 5 /* ... */))- '''-# ----# name: TestInsight.test_listing_insights_does_not_nplus1.29- '''- SELECT "posthog_taggeditem"."id",- "posthog_taggeditem"."tag_id",- "posthog_taggeditem"."dashboard_id",- "posthog_taggeditem"."insight_id",- "posthog_taggeditem"."event_definition_id",- "posthog_taggeditem"."property_definition_id",- "posthog_taggeditem"."action_id",- "posthog_taggeditem"."feature_flag_id",- "posthog_taggeditem"."experiment_saved_metric_id",- "posthog_taggeditem"."ticket_id",- "posthog_taggeditem"."account_id",- "posthog_taggeditem"."endpoint_id",- "posthog_taggeditem"."replay_scanner_id",- "posthog_taggeditem"."project_id"- FROM "posthog_taggeditem"- WHERE "posthog_taggeditem"."insight_id" IN (1,- 2,- 3,- 4,- 5 /* ... */)- '''-# ---# name: TestInsight.test_listing_insights_does_not_nplus1.3'''SELECT "posthog_organizationmembership"."id",@@ -1580,6 +1686,48 @@'''# ---# name: TestInsight.test_listing_insights_does_not_nplus1.30+ '''+ SELECT "posthog_dashboardtile"."id",+ "posthog_dashboardtile"."dashboard_id",+ "posthog_dashboardtile"."insight_id",+ "posthog_dashboardtile"."deleted"+ 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" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */))+ '''+# ---+# name: TestInsight.test_listing_insights_does_not_nplus1.31+ '''+ SELECT "posthog_taggeditem"."id",+ "posthog_taggeditem"."tag_id",+ "posthog_taggeditem"."dashboard_id",+ "posthog_taggeditem"."insight_id",+ "posthog_taggeditem"."event_definition_id",+ "posthog_taggeditem"."property_definition_id",+ "posthog_taggeditem"."action_id",+ "posthog_taggeditem"."feature_flag_id",+ "posthog_taggeditem"."experiment_saved_metric_id",+ "posthog_taggeditem"."ticket_id",+ "posthog_taggeditem"."account_id",+ "posthog_taggeditem"."endpoint_id",+ "posthog_taggeditem"."replay_scanner_id",+ "posthog_taggeditem"."project_id"+ FROM "posthog_taggeditem"+ WHERE "posthog_taggeditem"."insight_id" IN (1,+ 2,+ 3,+ 4,+ 5 /* ... */)+ '''+# ---+# name: TestInsight.test_listing_insights_does_not_nplus1.32'''SELECT "posthog_taggeditem"."id","posthog_taggeditem"."tag_id",diff --git a/products/product_analytics/backend/tests/api/test_insight.py b/products/product_analytics/backend/tests/api/test_insight.pyindex 95457449e325..2c7d60d3f029 100644--- a/products/product_analytics/backend/tests/api/test_insight.py+++ b/products/product_analytics/backend/tests/api/test_insight.py@@ -33,6 +33,7 @@ from posthog.schema import (EventsNode,EventsQuery,FilterLogicalOperator,+ FunnelsQuery,HogQLFilters,HogQLQuery,InsightNodeKind,@@ -40,6 +41,7 @@ from posthog.schema import (NodeKind,PropertyGroupFilter,PropertyGroupFilterValue,+ StickinessQuery,TrendsQuery,)@@ -53,6 +55,7 @@ from posthog.hogql_queries.query_runner import SHARED_FORCE_BLOCKING_STALENESS_Wfrom posthog.models import Filter, OrganizationMembership, SharingConfiguration, Team, Userfrom posthog.models.project import Projectfrom posthog.test.db_context_capturing import capture_db_queries+from posthog.test.insight_queries import default_pageview_query, insight_queryfrom posthog.test.persons import create_personfrom products.access_control.backend.models.access_control import AccessControl@@ -64,6 +67,21 @@ from products.dashboards.backend.models.dashboard_tile import DashboardTile, Texfrom products.product_analytics.backend.facade.models import Insight, InsightVariablefrom products.product_analytics.backend.models.insight import InsightViewed+# What "insight created"/"insight updated" report for a single-event trends query.+PAGEVIEW_QUERY_ANALYTICS_PROPERTIES = {+ "query_kind": "InsightVizNode",+ "query_source_kind": "TrendsQuery",+ "series_length": 1,+ "event_entity_count": 1,+ "action_entity_count": 0,+ "data_warehouse_entity_count": 0,+ "has_properties": False,+ "behavioral_filter_count": 0,+ # No `breakdown_type` or `filter_test_accounts`: the query sets neither, and both are reported only+ # when present. `test_insight_model.py` covers what they report for a query that does set them.+ "has_formula": False,+}+class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):maxDiff = None@@ -91,42 +109,47 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):]self.assertEqual(len(legacy_calls), 1)- def test_creating_legacy_filter_insight_blocked_with_feature_flag(self) -> None:- with patch(- "products.product_analytics.backend.presentation.insight.feature_enabled_or_false", return_value=True- ) as mock_feature_enabled:- response = self.client.post(- f"/api/projects/{self.team.id}/insights/",- {"name": "Legacy filter insight", "filters": {"insight": "TRENDS", "events": [{"id": "$pageview"}]}},- )+ def test_creating_insight_with_legacy_filters_is_rejected(self) -> None:+ response = self.client.post(+ f"/api/projects/{self.team.id}/insights/",+ {"name": "Legacy filter insight", "filters": {"insight": "TRENDS", "events": [{"id": "$pageview"}]}},+ )self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)- self.assertEqual(- response.json()["detail"],- "Creating or updating insights with legacy filters is not available for this user.",+ self.assertTrue(+ response.json()["detail"].startswith(+ "Creating or updating insights with legacy filters is not available for this user."+ ))- legacy_filter_calls = [- c for c in mock_feature_enabled.call_args_list if c[0][0] == "legacy-insight-filters-disabled"- ]- self.assertEqual(len(legacy_filter_calls), 1)- def test_creating_query_insight_not_blocked_by_legacy_filter_flag(self) -> None:- with patch(- "products.product_analytics.backend.presentation.insight.feature_enabled_or_false", return_value=True- ) as mock_feature_enabled:- response = self.client.post(- f"/api/projects/{self.team.id}/insights/",- {- "name": "Query insight",- "query": InsightVizNode(source=TrendsQuery(series=[EventsNode(event="$pageview")])).model_dump(),- },- )+ def test_updating_an_insight_with_legacy_filters_is_rejected(self) -> None:+ insight = Insight.objects.create(+ team=self.team,+ name="Query insight",+ query=default_pageview_query(),+ )++ response = self.client.patch(+ f"/api/projects/{self.team.id}/insights/{insight.id}/",+ {"filters": {"insight": "TRENDS", "events": [{"id": "$pageview"}]}},+ )++ self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)++ def test_creating_an_insight_without_a_query_is_rejected(self) -> None:+ # An empty body used to mint a shell insight with no definition at all.+ response = self.client.post(f"/api/projects/{self.team.id}/insights/", {"name": "Shell insight"})++ self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)+ self.assertEqual(response.json()["attr"], "query")++ def test_creating_query_insight_is_allowed(self) -> None:+ response = self.client.post(+ f"/api/projects/{self.team.id}/insights/",+ {"name": "Query insight", "query": default_pageview_query()},+ )self.assertEqual(response.status_code, status.HTTP_201_CREATED)- legacy_filter_calls = [- c for c in mock_feature_enabled.call_args_list if c[0][0] == "legacy-insight-filters-disabled"- ]- self.assertEqual(len(legacy_filter_calls), 0)def test_get_insight_items(self) -> None:filter_dict = {@@ -215,7 +238,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):with freeze_time("2021-08-23T12:00:00Z"):response_1 = self.client.post(f"/api/projects/{self.team.id}/insights/",- {"name": "test"},+ {"name": "test", "query": default_pageview_query()},headers={"Referer": "https://posthog.com/my-referer", "X-Posthog-Session-Id": "my-session-id"},)self.assertEqual(response_1.status_code, status.HTTP_201_CREATED)@@ -247,6 +270,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):"mcp_protocol_version": None,"mcp_oauth_client_name": None,"insight_id": response_1.json()["short_id"],+ **PAGEVIEW_QUERY_ANALYTICS_PROPERTIES,"$set_once": {"email": self.user.email},},groups=ANY,@@ -295,6 +319,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):"mcp_protocol_version": None,"mcp_oauth_client_name": None,"insight_id": insight_short_id,+ **PAGEVIEW_QUERY_ANALYTICS_PROPERTIES,"$set_once": {"email": self.user.email},},groups=ANY,@@ -307,7 +332,11 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):with freeze_time("2021-10-21T12:00:00Z"):response_3 = self.client.patch(f"/api/projects/{self.team.id}/insights/{insight_id}",- {"filters": {"events": []}},+ {+ "query": insight_query(+ {"kind": "TrendsQuery", "series": [{"kind": "EventsNode", "event": "$autocapture"}]}+ )+ },)self.assertEqual(response_3.status_code, status.HTTP_200_OK)self.assertLessEqual(@@ -474,18 +503,11 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):self.assertEqual(response.json()["results"][0]["name"], "Regular Insight")def test_get_insight_in_dashboard_context(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- }-dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "the dashboard", "filters": {"date_from": "-180d"}})- insight_id, _ = self.dashboard_api.create_insight(- {"filters": filter_dict, "name": "insight", "dashboards": [dashboard_id]}- )+ insight_id, _ = self.dashboard_api.create_insight({"name": "insight", "dashboards": [dashboard_id]})insight_in_isolation = self.dashboard_api.get_insight(insight_id)self.assertIsNotNone(insight_in_isolation.get("filters_hash", None))@@ -540,18 +562,11 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):mock_record_outcome.assert_not_called()def test_get_insight_in_shared_context(self) -> None:- filter_dict = {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- }-dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "the dashboard", "filters": {"date_from": "-180d"}})- insight_id, _ = self.dashboard_api.create_insight(- {"filters": filter_dict, "name": "insight", "dashboards": [dashboard_id]}- )+ insight_id, _ = self.dashboard_api.create_insight({"name": "insight", "dashboards": [dashboard_id]})sharing_config = SharingConfiguration.objects.create(team=self.team, insight_id=insight_id, enabled=True)valid_url = f"{settings.SITE_URL}/shared/{sharing_config.access_token}"@@ -609,9 +624,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):# never execute the body of. A 200 alone doesn't prove this: insight_result's# broad except Exception swallows calculation crashes into a query_status error# and still renders 200, so assert the embedded result actually computed.- filter_dict = {"events": [{"id": "$pageview"}]}-- insight_id, _ = self.dashboard_api.create_insight({"filters": filter_dict, "name": "insight"})+ insight_id, _ = self.dashboard_api.create_insight({"name": "insight"})sharing_config = SharingConfiguration.objects.create(team=self.team, insight_id=insight_id, enabled=True)# .json suffix returns exported_data directly, skipping exporter.html rendering@@ -631,9 +644,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):# reaching the override helpers, a viewer could pair a unique filters_override with# refresh=force_blocking on every request — each novel value is a fresh cache miss that# recomputes synchronously, defeating the throttle this PR relies on.- insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"events": [{"id": "$pageview"}]}, "name": "insight"}- )+ insight_id, _ = self.dashboard_api.create_insight({"name": "insight"})sharing_config = SharingConfiguration.objects.create(team=self.team, insight_id=insight_id, enabled=True)valid_url = f"{settings.SITE_URL}/shared/{sharing_config.access_token}"@@ -1054,7 +1065,6 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):data={"short_id": f"insight{i}","dashboards": [dashboard.pk],- "filters": {"events": [{"id": "$pageview"}]},})@@ -1088,7 +1098,6 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):data={"short_id": short_id,"dashboards": [d.pk for d in dashboards],- "filters": {"events": [{"id": "$pageview"}]},})soft_deleted_dashboard = Dashboard.objects.create(name=f"deleted dashboard for {short_id}", team=self.team)@@ -1138,9 +1147,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):url = f"/api/projects/{self.team.id}/insights/?saved=true&limit=30"def _create_insight_with_alerts(short_id: str) -> None:- insight_id, _ = self.dashboard_api.create_insight(- data={"short_id": short_id, "filters": {"events": [{"id": "$pageview"}]}}- )+ insight_id, _ = self.dashboard_api.create_insight(data={"short_id": short_id})threshold = Threshold.objects.create(team=self.team,insight_id=insight_id,@@ -1192,12 +1199,8 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):})- self.dashboard_api.create_insight(- data={- "short_id": f"insight",- "filters": {"insight": "TRENDS", "events": [{"id": "$pageview"}]},- }- )+ # Written through the ORM because the API only accepts a query, while legacy rows still have to list.+ Insight.objects.create(team=self.team, filters={"insight": "TRENDS", "events": [{"id": "$pageview"}]})self.dashboard_api.create_insight(data={"short_id": f"insight",@@ -1213,26 +1216,21 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):journeys_insight_id, _ = self.dashboard_api.create_insight(data={"query": {"kind": "InsightVizNode", "source": {"kind": "PathsV2Query"}}})- paths_insight_id, _ = self.dashboard_api.create_insight(- data={"filters": {"insight": "PATHS", "events": [{"id": "$pageview"}]}}+ # Written through the ORM because the API only accepts a query, while legacy rows still have to list.+ paths_insight = Insight.objects.create(+ team=self.team, filters={"insight": "PATHS", "events": [{"id": "$pageview"}]})journeys_response = self.client.get(f"/api/environments/{self.team.pk}/insights/?insight=JOURNEYS")assert [insight["id"] for insight in journeys_response.json()["results"]] == [journeys_insight_id]paths_response = self.client.get(f"/api/environments/{self.team.pk}/insights/?insight=PATHS")- assert [insight["id"] for insight in paths_response.json()["results"]] == [paths_insight_id]+ assert [insight["id"] for insight in paths_response.json()["results"]] == [paths_insight.id]def test_can_list_insights_by_which_dashboards_they_are_in(self) -> None:- insight_one_id, _ = self.dashboard_api.create_insight(- {"name": "insight 1", "filters": {"events": [{"id": "$pageview"}]}}- )- insight_two_id, _ = self.dashboard_api.create_insight(- {"name": "insight 2", "filters": {"events": [{"id": "$pageview"}]}}- )- insight_three_id, _ = self.dashboard_api.create_insight(- {"name": "insight 3", "filters": {"events": [{"id": "$pageview"}]}}- )+ insight_one_id, _ = self.dashboard_api.create_insight({"name": "insight 1"})+ insight_two_id, _ = self.dashboard_api.create_insight({"name": "insight 2"})+ insight_three_id, _ = self.dashboard_api.create_insight({"name": "insight 3"})dashboard_one_id, _ = self.dashboard_api.create_dashboard({"name": "dashboard 1", "filters": {"date_from": "-180d"}}@@ -1274,11 +1272,14 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):f"/api/projects/{self.team.id}/insights",data={"name": "a created dashboard",- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },+ "query": insight_query(+ {+ "kind": "TrendsQuery",+ "series": [{"kind": "EventsNode", "event": "$pageview"}],+ "properties": [{"type": "event", "key": "$browser", "value": "Mac OS X"}],+ "dateRange": {"date_from": "-90d"},+ }+ ),},)self.assertEqual(response.status_code, status.HTTP_201_CREATED)@@ -1288,8 +1289,10 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):objects = Insight.objects.all()self.assertEqual(objects.count(), 1)- self.assertEqual(objects[0].filters["events"][0]["id"], "$pageview")- self.assertEqual(objects[0].filters["date_from"], "-90d")+ source = objects[0].query["source"] if objects[0].query else None+ assert source is not None+ self.assertEqual(source["series"][0]["event"], "$pageview")+ self.assertEqual(source["dateRange"]["date_from"], "-90d")self.assertEqual(len(objects[0].short_id), 8)self.assert_insight_activity(@@ -1316,13 +1319,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def test_create_insight_with_no_names_logs_no_activity(self) -> None:response = self.client.post(f"/api/projects/{self.team.id}/insights",- data={- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- }- },+ data={"query": default_pageview_query()},)self.assertEqual(response.status_code, status.HTTP_201_CREATED)response_data = response.json()@@ -1334,16 +1331,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def test_create_insight_items_on_a_dashboard(self) -> None:dashboard_id, _ = self.dashboard_api.create_dashboard({})- insight_id, _ = self.dashboard_api.create_insight(- {- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- "dashboards": [dashboard_id],- }- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id]})tile: DashboardTile = DashboardTile.objects.get(dashboard__id=dashboard_id, insight__id=insight_id)self.assertIsNotNone(tile)@@ -1352,16 +1340,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):dashboard_id, _ = self.dashboard_api.create_dashboard({})deleted_dashboard_id, _ = self.dashboard_api.create_dashboard({})- insight_id, _ = self.dashboard_api.create_insight(- {- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- "dashboards": [dashboard_id, deleted_dashboard_id],- }- )+ insight_id, _ = self.dashboard_api.create_insight({"dashboards": [dashboard_id, deleted_dashboard_id]})self.dashboard_api.update_dashboard(deleted_dashboard_id, {"deleted": True})@@ -1382,16 +1361,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def test_insight_items_on_a_dashboard_ignore_deleted_dashboard_tiles(self) -> None:dashboard_id, _ = self.dashboard_api.create_dashboard({})- insight_id, insight_json = self.dashboard_api.create_insight(- {- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- "dashboards": [dashboard_id],- }- )+ insight_id, insight_json = self.dashboard_api.create_insight({"dashboards": [dashboard_id]})tile: DashboardTile = DashboardTile.objects.get(insight_id=insight_id, dashboard_id=dashboard_id)tile.deleted = True@@ -1588,10 +1558,13 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):@parameterized.expand([- ("legacy_filters_funnels", {"insight": "FUNNELS"}, None, "funnels"),+ (+ "query_funnels",+ InsightVizNode(source=FunnelsQuery(series=[EventsNode(event="$pageview")])).model_dump(),+ "funnels",+ ),("query_trends",- None,InsightVizNode(source=TrendsQuery(series=[EventsNode(event="$pageview")])).model_dump(),"trends",),@@ -1601,20 +1574,14 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def test_creating_insight_with_dashboard_fires_tile_added_event(self,_name: str,- filters: dict | None,- query: dict | None,+ query: dict,expected_insight_type: str,mock_report_user_action: mock.Mock,) -> None:dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "test"})mock_report_user_action.reset_mock()- data: dict = {"dashboards": [dashboard_id]}- if filters:- data["filters"] = filters- if query:- data["query"] = query- self.dashboard_api.create_insight(data)+ self.dashboard_api.create_insight({"dashboards": [dashboard_id], "query": query})mock_report_user_action.assert_any_call(self.user,@@ -1631,7 +1598,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):) -> None:dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "Important dashboard"})- self.dashboard_api.create_insight({"filters": {"insight": "TRENDS"}, "dashboards": [dashboard_id]})+ self.dashboard_api.create_insight({"dashboards": [dashboard_id]})limit_call = next(call for call in mock_report_user_action.call_args_list if call.args[1] == "resource limit hit"@@ -1642,7 +1609,9 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):@patch("products.product_analytics.backend.presentation.insight.report_user_action")def test_adding_insight_to_dashboard_fires_tile_added_event(self, mock_report_user_action: mock.Mock) -> None:dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "test"})- insight_id, _ = self.dashboard_api.create_insight({"filters": {"insight": "STICKINESS"}})+ insight_id, _ = self.dashboard_api.create_insight(+ {"query": InsightVizNode(source=StickinessQuery(series=[EventsNode(event="$pageview")])).model_dump()}+ )mock_report_user_action.reset_mock()self.dashboard_api.add_insight_to_dashboard([dashboard_id], insight_id)@@ -1680,7 +1649,10 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):def test_removing_insight_from_dashboard_fires_tile_removed_event(self, mock_report_user_action: mock.Mock) -> None:dashboard_id, _ = self.dashboard_api.create_dashboard({"name": "test"})insight_id, _ = self.dashboard_api.create_insight(- {"filters": {"insight": "STICKINESS"}, "dashboards": [dashboard_id]}+ {+ "query": InsightVizNode(source=StickinessQuery(series=[EventsNode(event="$pageview")])).model_dump(),+ "dashboards": [dashboard_id],+ })mock_report_user_action.reset_mock()@@ -1761,11 +1733,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):f"/api/projects/{self.team.id}/insights",data={"derived_name": "pageview unique users",- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },+ "query": default_pageview_query(),},)self.assertEqual(response.status_code, status.HTTP_201_CREATED)@@ -1883,68 +1851,24 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):self.assertEqual(response.status_code, status.HTTP_200_OK)self.assertEqual(response.json()["filters_hash"], original_filters_hash)- @skip("Compatibility issue caused by test account filters")- def test_update_insight_filters(self) -> None:- insight = Insight.objects.create(- team=self.team,- name="insight with custom filters",- created_by=self.user,- filters={"events": [{"id": "$pageview"}]},- )-- for custom_name, expected_name in zip(- ["Custom filter", 100, "", " ", None],- ["Custom filter", "100", None, None, None],- ):- response = self.client.patch(- f"/api/projects/{self.team.id}/insights/{insight.id}",- {"filters": {"events": [{"id": "$pageview", "custom_name": custom_name}]}},- )-- self.assertEqual(response.status_code, status.HTTP_200_OK)-- response_data = response.json()- self.assertEqual(response_data["filters"]["events"][0]["custom_name"], expected_name)- insight.refresh_from_db()- self.assertEqual(insight.filters["events"][0]["custom_name"], expected_name)-def test_save_new_funnel(self) -> None:dashboard = Dashboard.objects.create(name="My Dashboard", team=self.team)response = self.client.post(f"/api/projects/{self.team.id}/insights",data={- "filters": {- "insight": "FUNNELS",- "events": [- {- "id": "$pageview",- "math": None,- "name": "$pageview",- "type": "events",- "order": 0,- "properties": [],- "math_hogql": None,- "math_property": None,- },- {- "id": "$rageclick",- "math": None,- "name": "$rageclick",- "type": "events",- "order": 2,- "properties": [],- "math_hogql": None,- "math_property": None,- },- ],- "display": "FunnelViz",- "interval": "day",- "date_from": "-30d",- "actions": [],- "new_entity": [],- "layout": "horizontal",- },+ "query": insight_query(+ {+ "kind": "FunnelsQuery",+ "series": [+ {"kind": "EventsNode", "event": "$pageview"},+ {"kind": "EventsNode", "event": "$rageclick"},+ ],+ "interval": "day",+ "dateRange": {"date_from": "-30d"},+ "funnelsFilter": {"layout": "horizontal"},+ }+ ),"name": "My Funnel One","dashboard": dashboard.pk,},@@ -1953,11 +1877,13 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):objects = Insight.objects.all()self.assertEqual(objects.count(), 1)- self.assertEqual(objects[0].filters["events"][1]["id"], "$rageclick")- self.assertEqual(objects[0].filters["display"], "FunnelViz")- self.assertEqual(objects[0].filters["interval"], "day")- self.assertEqual(objects[0].filters["date_from"], "-30d")- self.assertEqual(objects[0].filters["layout"], "horizontal")+ source = objects[0].query["source"] if objects[0].query else None+ assert source is not None+ self.assertEqual(source["kind"], "FunnelsQuery")+ self.assertEqual(source["series"][1]["event"], "$rageclick")+ self.assertEqual(source["interval"], "day")+ self.assertEqual(source["dateRange"]["date_from"], "-30d")+ self.assertEqual(source["funnelsFilter"]["layout"], "horizontal")self.assertEqual(len(objects[0].short_id), 8)def test_insight_refreshing_legacy_conversion(self) -> None:@@ -1984,25 +1910,25 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):)with freeze_time("2012-01-15T04:01:34.000Z"):- response = self.client.post(- f"/api/projects/{self.team.id}/insights",- data={- "filters": {- "events": [{"id": "$pageview"}],- "properties": [- {- "key": "another",- "value": "never_return_this",- "operator": "is_not",- }- ],- },- "dashboards": [dashboard_id],+ # Written through the ORM because the API no longer accepts legacy filters, while rows+ # stored before that still have to render through read-time conversion.+ insight = Insight.objects.create(+ team=self.team,+ filters={+ "events": [{"id": "$pageview"}],+ "properties": [+ {+ "key": "another",+ "value": "never_return_this",+ "operator": "is_not",+ }+ ],},- ).json()- self.assertEqual(response["last_refresh"], None)+ )+ DashboardTile.objects.create(insight=insight, dashboard=Dashboard.objects.get(pk=dashboard_id))+ self.assertEqual(insight.last_refresh, None)- response = self.client.get(f"/api/projects/{self.team.id}/insights/{response['id']}/?refresh=true").json()+ response = self.client.get(f"/api/projects/{self.team.id}/insights/{insight.id}/?refresh=true").json()self.assertEqual(response["result"][0]["data"], [0, 0, 0, 0, 0, 0, 2, 0])self.assertEqual(response["last_refresh"], "2012-01-15T04:01:34Z")self.assertEqual(response["last_modified_at"], "2012-01-15T04:01:34Z")@@ -3396,14 +3322,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):dashboard_other_team: Dashboard = Dashboard.objects.create(team=another_team)self.dashboard_api.create_insight(- data={- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- "dashboards": [dashboard_own_team.pk, dashboard_other_team.pk],- },+ data={"dashboards": [dashboard_own_team.pk, dashboard_other_team.pk]},expected_status=status.HTTP_400_BAD_REQUEST,)@@ -3422,13 +3341,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):# logged in to self.team and trying to create an insight in another_teamself.dashboard_api.create_insight(team_id=another_team.pk,- data={- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- },+ data={},expected_status=status.HTTP_400_BAD_REQUEST,)@@ -3437,16 +3350,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):dashboard_other_team: Dashboard = Dashboard.objects.create(team=another_team)dashboard_own_team: Dashboard = Dashboard.objects.create(team=self.team)- insight_id, _ = self.dashboard_api.create_insight(- data={- "filters": {- "events": [{"id": "$pageview"}],- "properties": [{"key": "$browser", "value": "Mac OS X"}],- "date_from": "-90d",- },- "dashboards": [dashboard_own_team.pk],- }- )+ insight_id, _ = self.dashboard_api.create_insight(data={"dashboards": [dashboard_own_team.pk]})response = self.client.patch(f"/api/projects/{self.team.id}/insights/{insight_id}",@@ -4738,7 +4642,7 @@ class TestInsight(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):f"/api/projects/{self.team.id}/insights/",{"name": "My test insight in folder",- "filters": {"events": [{"id": "$pageview"}]},+ "query": default_pageview_query(),"_create_in_folder": "Special Folder/Subfolder","saved": True,},diff --git a/products/product_analytics/backend/tests/api/test_insight_query.py b/products/product_analytics/backend/tests/api/test_insight_query.pyindex e3cf5f834a29..b54cbd3f96fd 100644--- a/products/product_analytics/backend/tests/api/test_insight_query.py+++ b/products/product_analytics/backend/tests/api/test_insight_query.py@@ -262,25 +262,6 @@ class TestInsight(ClickhouseTestMixin, LicensedTestMixin, APIBaseTest, QueryMatcassert response.json()["attr"] == "query"assert Insight.objects.count() == insight_count_before- @patch(- "products.product_analytics.backend.presentation.insight_write_validation.feature_enabled_or_false",- return_value=True,- )- def test_accepts_filters_the_rules_reject_when_the_stored_query_still_renders(self, _flag: Any) -> None:- insight_id, _ = self.dashboard_api.create_insight(- {- "name": "Insight with a query",- "query": {"kind": "StickinessQuery", "series": [{"kind": "EventsNode", "event": "$pageview"}]},- }- )-- response = self.client.patch(- f"/api/projects/{self.team.id}/insights/{insight_id}",- {"filters": {"insight": "TRENDS", "events": []}},- )-- assert response.status_code == status.HTTP_200_OK-def test_can_list_insights_including_those_with_only_queries(self) -> None:self.dashboard_api.create_insight({"name": "Insight with filters"})self.dashboard_api.create_insight(