From 8b648e1a20cc6aa6707a8ca3a7b6737be0c7b47b Mon Sep 17 00:00:00 2001 From: Jiaxiao Zheng Date: Mon, 9 Mar 2020 10:27:36 -0700 Subject: [PATCH] [Frontend] Fix the TFMA/TFDV viz behavior when caching is used. (#3228) * include cached execution * apply suggestion * typo fix * lint * improve style * fix typo * fix --- frontend/src/lib/OutputArtifactLoader.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/OutputArtifactLoader.ts b/frontend/src/lib/OutputArtifactLoader.ts index da2f2796114d..875f84e641ef 100644 --- a/frontend/src/lib/OutputArtifactLoader.ts +++ b/frontend/src/lib/OutputArtifactLoader.ts @@ -472,10 +472,12 @@ async function getExecutionInContextWithPodName( return undefined; // Not found, this is expected to happen normally when there's no mlmd data. } const state = foundExecution.getPropertiesMap().get('state'); - if (!state || state.getStringValue() !== 'complete') { - return undefined; // Execution doesn't have a valid state, or it has not finished. + // Both complete and cached executions are considered valid. + if (state && ['complete', 'cached'].includes(state.getStringValue())) { + return foundExecution; } - return foundExecution; + // No valid execution found. + return undefined; } /**