This is an automated email from the ASF dual-hosted git repository.
justinpark pushed a commit to branch 5.0-extensions
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/5.0-extensions by this push:
new e30a0b0a8f4 fix(dashboard): Avoid calling loadData for invisible
charts on virtual rendering (#37452)
e30a0b0a8f4 is described below
commit e30a0b0a8f469c782cfa6a83ea071d35f0778e8d
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)
(cherry picked from commit be404f9b84440f5141a8ea85e4ac605e0b752872)
---
.../superset-ui-core/src/utils/featureFlags.ts | 1 +
superset-frontend/src/components/Chart/Chart.tsx | 18 +++++++++++++---
superset/config.py | 25 ++++++++++++++++++++++
superset/views/base.py | 1 +
4 files changed, 42 insertions(+), 3 deletions(-)
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 ba5308a3bb4..51a771326ea 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
+++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts
@@ -31,6 +31,7 @@ export enum FeatureFlag {
ChartPluginsExperimental = 'CHART_PLUGINS_EXPERIMENTAL',
ConfirmDashboardDiff = 'CONFIRM_DASHBOARD_DIFF',
DashboardVirtualization = 'DASHBOARD_VIRTUALIZATION',
+ DashboardVirtualizationDeferData = 'DASHBOARD_VIRTUALIZATION_DEFER_DATA',
DashboardRbac = 'DASHBOARD_RBAC',
DatapanelClosedByDefault = 'DATAPANEL_CLOSED_BY_DEFAULT',
/** @deprecated */
diff --git a/superset-frontend/src/components/Chart/Chart.tsx
b/superset-frontend/src/components/Chart/Chart.tsx
index 94f521bcd1f..6269327d1a4 100644
--- a/superset-frontend/src/components/Chart/Chart.tsx
+++ b/superset-frontend/src/components/Chart/Chart.tsx
@@ -195,7 +195,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,
@@ -291,9 +305,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 bc3841d23ff..3e394c943fe 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -521,6 +521,31 @@ DEFAULT_FEATURE_FLAGS: dict[str, bool] = {
"CACHE_IMPERSONATION": False,
# Enable caching per user key for Superset cache (not database cache
impersonation)
"CACHE_QUERY_BY_USER": False,
+ # Enables CSS Templates in Settings menu and dashboard forms
+ # @lifecycle: stable
+ # @category: runtime_config
+ "CSS_TEMPLATES": True,
+ # Role-based access control for dashboards
+ # @lifecycle: stable
+ # @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
+ "DATAPANEL_CLOSED_BY_DEFAULT": False,
+ # Enable drill-by functionality in charts
+ # @lifecycle: stable
+ # @category: runtime_config
+ "DRILL_BY": True,
+ # Enable Druid JOINs (requires Druid version with JOIN support)
+ # @lifecycle: stable
+ # @category: runtime_config
+ "DRUID_JOINS": False,
# Enable sharing charts with embedding
"EMBEDDABLE_CHARTS": True,
"DRILL_TO_DETAIL": True, # deprecated
diff --git a/superset/views/base.py b/superset/views/base.py
index a00c91338f8..aa9734afc5c 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -89,6 +89,7 @@ FRONTEND_CONF_KEYS = (
"DASHBOARD_AUTO_REFRESH_MODE",
"DASHBOARD_AUTO_REFRESH_INTERVALS",
"DASHBOARD_VIRTUALIZATION",
+ "DASHBOARD_VIRTUALIZATION_DEFER_DATA",
"SCHEDULED_QUERIES",
"EXCEL_EXTENSIONS",
"CSV_EXTENSIONS",