This is an automated email from the ASF dual-hosted git repository. beto pushed a commit to branch dbt-metricflow in repository https://gitbox.apache.org/repos/asf/superset.git
commit ff87aa155ad4d7f17f7076e548e95f08fad8672c Author: Beto Dealmeida <robe...@dealmeida.net> AuthorDate: Thu Jul 17 20:13:40 2025 -0400 Checkpoint --- .../DndColumnSelectControl/ColumnSelectPopover.tsx | 26 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx index 2e6ab70e4a..089ae98e2c 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx @@ -45,6 +45,7 @@ import { SQLEditor, EmptyState, Tooltip, + Icons, } from '@superset-ui/core/components'; import sqlKeywords from 'src/SqlLab/utils/sqlKeywords'; @@ -164,6 +165,7 @@ const ColumnSelectPopover = ({ >(initialSimpleColumn); const [selectedTab, setSelectedTab] = useState<string | null>(null); const [validDimensions, setValidDimensions] = useState<string[] | null>(null); + const [isLoadingValidDimensions, setIsLoadingValidDimensions] = useState(false); const [resizeButton, width, height] = useResizeButton( POPOVER_INITIAL_WIDTH, @@ -187,7 +189,8 @@ const ColumnSelectPopover = ({ ) || [[], []]; // For semantic layer datasets, filter simple columns to show only valid dimensions - if (isSemanticLayer && validDimensions !== null) { + // Show all columns while loading, then filter when API response is available + if (isSemanticLayer && !isLoadingValidDimensions && validDimensions !== null) { const validDimensionNames = new Set(validDimensions); const filteredSimple = simple.filter(column => validDimensionNames.has(column.column_name) @@ -197,7 +200,7 @@ const ColumnSelectPopover = ({ return [calculated, simple]; }, - [columns, isSemanticLayer, validDimensions], + [columns, isSemanticLayer, validDimensions, isLoadingValidDimensions], ); const onSqlExpressionChange = useCallback( @@ -261,6 +264,8 @@ const ColumnSelectPopover = ({ // Fetch valid dimensions for semantic layer datasets useEffect(() => { if (isSemanticLayer && formData && datasource) { + setIsLoadingValidDimensions(true); + const fetchValidDimensions = async () => { try { const queryFields = collectQueryFields(formData); @@ -271,16 +276,24 @@ const ColumnSelectPopover = ({ ); if (validationResult) { setValidDimensions(validationResult.dimensions); + } else { + setValidDimensions(null); } } catch (error) { console.warn('Failed to fetch valid dimensions:', error); setValidDimensions(null); + } finally { + setIsLoadingValidDimensions(false); } }; - fetchValidDimensions(); + // Make it non-blocking by using setTimeout + setTimeout(() => { + fetchValidDimensions(); + }, 0); } else { setValidDimensions(null); + setIsLoadingValidDimensions(false); } }, [isSemanticLayer, formData, datasource]); @@ -524,7 +537,12 @@ const ColumnSelectPopover = ({ onChange={onSimpleColumnChange} allowClear autoFocus={!selectedSimpleColumn} - placeholder={t('%s column(s)', simpleColumns.length)} + loading={isSemanticLayer && isLoadingValidDimensions} + placeholder={ + isSemanticLayer && isLoadingValidDimensions + ? t('Loading valid dimensions...') + : t('%s column(s)', simpleColumns.length) + } options={simpleColumns.map(simpleColumn => ({ value: simpleColumn.column_name, label: (