From 7bd107fcdca7cd9aa281015522d83adcd5939b11 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 12 May 2026 10:13:37 -0700 Subject: [PATCH] fix(Chart): port master's ErrorInfo typing + semantic-layer databaseName Carry forward master changes that landed during this PR's lifetime: - #38563 (React 18): handleRenderContainerFailure uses ErrorInfo type and info?.componentStack ?? null instead of the legacy nullable shim. - #37815 (semantic layer): databaseName falls back to datasource?.parent?.name before datasource?.database?.name. Co-Authored-By: Claude Sonnet 4.6 --- superset-frontend/src/components/Chart/Chart.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/components/Chart/Chart.tsx b/superset-frontend/src/components/Chart/Chart.tsx index 1b011db2a2d..1519837c747 100644 --- a/superset-frontend/src/components/Chart/Chart.tsx +++ b/superset-frontend/src/components/Chart/Chart.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { useCallback, useEffect, useRef } from 'react'; +import { ErrorInfo, useCallback, useEffect, useRef } from 'react'; import { t } from '@apache-superset/core/translation'; import { logging } from '@apache-superset/core/utils'; import { @@ -253,12 +253,12 @@ function Chart({ ]); const handleRenderContainerFailure = useCallback( - (error: Error, info: { componentStack: string } | null) => { + (error: Error, info: ErrorInfo) => { logging.warn(error); actions.chartRenderingFailed( error.toString(), chartId, - info ? info.componentStack : null, + info?.componentStack ?? null, ); actions.logEvent(LOG_ACTIONS_RENDER_CHART, { @@ -421,7 +421,9 @@ function Chart({ ], ); - const databaseName = datasource?.database?.name as string | undefined; + const databaseName = + datasource?.parent?.name ?? + (datasource?.database?.name as string | undefined); const isLoading = chartStatus === 'loading'; // Suppress spinner during auto-refresh to avoid visual flicker