Skip to content

Commit

Permalink
fix: Endless fetching for cancelled experiment without metrics (#9714)
Browse files Browse the repository at this point in the history
(cherry picked from commit 202ab62)
  • Loading branch information
AmanuelAaron authored and determined-ci committed Jul 24, 2024
1 parent 556de9c commit f84d4eb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const ExperimentVisualization: React.FC<Props> = ({ basePath, experiment }: Prop
const [typeKey, setTypeKey] = useState(() => {
return type && TYPE_KEYS.includes(type) ? type : DEFAULT_TYPE_KEY;
});
const [batches, setBatches] = useState<number[]>();
const [batches, setBatches] = useState<number[]>([]);
const [pageError, setPageError] = useState<PageError>();

const handleMetricNamesError = useCallback(() => {
Expand All @@ -131,14 +131,14 @@ const ExperimentVisualization: React.FC<Props> = ({ 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<VisualizationFilters>) => {
Expand All @@ -165,7 +165,7 @@ const ExperimentVisualization: React.FC<Props> = ({ 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(),
});
Expand All @@ -186,7 +186,7 @@ const ExperimentVisualization: React.FC<Props> = ({ basePath, experiment }: Prop
const visualizationFilters = useMemo(() => {
return (
<ExperimentVisualizationFilters
batches={batches || []}
batches={batches}
filters={filters}
fullHParams={fullHParams.current}
metrics={metrics}
Expand Down

0 comments on commit f84d4eb

Please sign in to comment.