This is an automated email from the ASF dual-hosted git repository.

justinpark pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new be404f9b844 fix(dashboard): Avoid calling loadData for invisible 
charts on virtual rendering (#37452)
be404f9b844 is described below

commit be404f9b84440f5141a8ea85e4ac605e0b752872
Author: JUST.in DO IT <[email protected]>
AuthorDate: Mon Feb 2 10:07:25 2026 -0800

    fix(dashboard): Avoid calling loadData for invisible charts on virtual 
rendering (#37452)
---
 docs/static/feature-flags.json                         |  7 +++++++
 .../superset-ui-core/src/utils/featureFlags.ts         |  1 +
 superset-frontend/src/components/Chart/Chart.tsx       | 18 +++++++++++++++---
 superset/config.py                                     |  4 ++++
 superset/views/base.py                                 |  1 +
 5 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/docs/static/feature-flags.json b/docs/static/feature-flags.json
index 95738dd913f..6ca4c2ea818 100644
--- a/docs/static/feature-flags.json
+++ b/docs/static/feature-flags.json
@@ -247,6 +247,13 @@
         "description": "Enables dashboard virtualization for improved 
performance",
         "category": "path_to_deprecation"
       },
+      {
+        "name": "DASHBOARD_VIRTUALIZATION_DEFER_DATA",
+        "default": false,
+        "lifecycle": "stable",
+        "description": "Supports simultaneous data and dashboard 
virtualization for backend performance",
+        "category": "runtime_config"
+      },
       {
         "name": "DATAPANEL_CLOSED_BY_DEFAULT",
         "default": false,
diff --git 
a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts 
b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
index 2bd09edafc2..46f832cc094 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
+++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
@@ -34,6 +34,7 @@ export enum FeatureFlag {
   ConfirmDashboardDiff = 'CONFIRM_DASHBOARD_DIFF',
   CssTemplates = 'CSS_TEMPLATES',
   DashboardVirtualization = 'DASHBOARD_VIRTUALIZATION',
+  DashboardVirtualizationDeferData = 'DASHBOARD_VIRTUALIZATION_DEFER_DATA',
   DashboardRbac = 'DASHBOARD_RBAC',
   DatapanelClosedByDefault = 'DATAPANEL_CLOSED_BY_DEFAULT',
   DatasetFolders = 'DATASET_FOLDERS',
diff --git a/superset-frontend/src/components/Chart/Chart.tsx 
b/superset-frontend/src/components/Chart/Chart.tsx
index 0b1ad8793b5..2d2303d34c6 100644
--- a/superset-frontend/src/components/Chart/Chart.tsx
+++ b/superset-frontend/src/components/Chart/Chart.tsx
@@ -192,7 +192,21 @@ class Chart extends PureComponent<ChartProps, {}> {
     }
   }
 
+  shouldRenderChart() {
+    return (
+      this.props.isInView ||
+      !isFeatureEnabled(FeatureFlag.DashboardVirtualization) ||
+      isCurrentUserBot()
+    );
+  }
+
   runQuery() {
+    if (
+      isFeatureEnabled(FeatureFlag.DashboardVirtualizationDeferData) &&
+      !this.shouldRenderChart()
+    ) {
+      return;
+    }
     // Create chart with POST request
     this.props.actions.postChartFormData(
       this.props.formData,
@@ -295,9 +309,7 @@ class Chart extends PureComponent<ChartProps, {}> {
   renderChartContainer() {
     return (
       <div className="slice_container" data-test="slice-container">
-        {this.props.isInView ||
-        !isFeatureEnabled(FeatureFlag.DashboardVirtualization) ||
-        isCurrentUserBot() ? (
+        {this.shouldRenderChart() ? (
           <ChartRenderer
             {...this.props}
             source={this.props.dashboardId ? 'dashboard' : 'explore'}
diff --git a/superset/config.py b/superset/config.py
index b048fc2f8d5..9731d80bd58 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -703,6 +703,10 @@ DEFAULT_FEATURE_FLAGS: dict[str, bool] = {
     # @category: runtime_config
     # @docs: 
https://superset.apache.org/docs/using-superset/creating-your-first-dashboard
     "DASHBOARD_RBAC": False,
+    # Supports simultaneous data and dashboard virtualization for backend 
performance
+    # @lifecycle: stable
+    # @category: runtime_config
+    "DASHBOARD_VIRTUALIZATION_DEFER_DATA": False,
     # Data panel closed by default in chart builder
     # @lifecycle: stable
     # @category: runtime_config
diff --git a/superset/views/base.py b/superset/views/base.py
index 6ad3c4e7809..afca4d2c448 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -94,6 +94,7 @@ FRONTEND_CONF_KEYS = (
     "DASHBOARD_AUTO_REFRESH_MODE",
     "DASHBOARD_AUTO_REFRESH_INTERVALS",
     "DASHBOARD_VIRTUALIZATION",
+    "DASHBOARD_VIRTUALIZATION_DEFER_DATA",
     "SCHEDULED_QUERIES",
     "EXCEL_EXTENSIONS",
     "CSV_EXTENSIONS",

Reply via email to