From 202ab621250d042c30b658c3386821beddceb306 Mon Sep 17 00:00:00 2001 From: Aaron Amanuel Date: Wed, 24 Jul 2024 17:27:46 -0400 Subject: [PATCH] fix: Endless fetching for cancelled experiment without metrics (#9714) --- .../ExperimentDetails/ExperimentVisualization.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webui/react/src/pages/ExperimentDetails/ExperimentVisualization.tsx b/webui/react/src/pages/ExperimentDetails/ExperimentVisualization.tsx index 89f1d0a4969..a05049766a2 100644 --- a/webui/react/src/pages/ExperimentDetails/ExperimentVisualization.tsx +++ b/webui/react/src/pages/ExperimentDetails/ExperimentVisualization.tsx @@ -115,7 +115,7 @@ const ExperimentVisualization: React.FC = ({ basePath, experiment }: Prop const [typeKey, setTypeKey] = useState(() => { return type && TYPE_KEYS.includes(type) ? type : DEFAULT_TYPE_KEY; }); - const [batches, setBatches] = useState(); + const [batches, setBatches] = useState([]); const [pageError, setPageError] = useState(); const handleMetricNamesError = useCallback(() => { @@ -131,14 +131,14 @@ const ExperimentVisualization: React.FC = ({ basePath, experiment }: Prop const { hasData, hasLoaded, isExperimentTerminal, isSupported } = useMemo(() => { return { hasData: !!metrics?.length, - hasLoaded: Loadable.isLoaded(loadableMetrics) && !!batches, + hasLoaded: Loadable.isLoaded(loadableMetrics), isExperimentTerminal: terminalRunStates.has(experiment.state), isSupported: !( ExperimentSearcherName.Single === experiment.config.searcher.name || ExperimentSearcherName.Pbt === experiment.config.searcher.name ), }; - }, [batches, experiment, loadableMetrics, metrics]); + }, [experiment, loadableMetrics, metrics]); const handleFiltersChange = useCallback( (newFilters: Partial) => { @@ -165,7 +165,7 @@ const ExperimentVisualization: React.FC = ({ basePath, experiment }: Prop const handleFiltersReset = useCallback(() => { store.set(VisualizationFilters, storagePath, { ...defaultFilters, - batch: batches?.first() || DEFAULT_BATCH, + batch: batches.first() || DEFAULT_BATCH, hParams: fullHParams.current.slice(0, MAX_HPARAM_COUNT), metric: getDefaultMetrics(), }); @@ -186,7 +186,7 @@ const ExperimentVisualization: React.FC = ({ basePath, experiment }: Prop const visualizationFilters = useMemo(() => { return (