From 4558b22e8486f4b3c2e8ff31aec9560793a1e548 Mon Sep 17 00:00:00 2001 From: ReiHashimoto <42664619+ReiHashimoto@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:14:44 +0900 Subject: [PATCH] fix bugs in run --- .../slice/DisplayData/DisplayDataSlice.ts | 8 ++++++-- .../common/core/workflow/workflow_writer.py | 18 +----------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/frontend/src/store/slice/DisplayData/DisplayDataSlice.ts b/frontend/src/store/slice/DisplayData/DisplayDataSlice.ts index bee91c8fe..55f5a6caf 100644 --- a/frontend/src/store/slice/DisplayData/DisplayDataSlice.ts +++ b/frontend/src/store/slice/DisplayData/DisplayDataSlice.ts @@ -1,4 +1,4 @@ -import { createSlice } from '@reduxjs/toolkit' +import { createSlice, isAnyOf } from '@reduxjs/toolkit' import { DATA_TYPE, DATA_TYPE_SET, @@ -25,7 +25,7 @@ import { deleteDisplayItem, setNewDisplayDataPath, } from '../VisualizeItem/VisualizeItemActions' - +import { run, runByCurrentUid } from 'store/slice/Pipeline/PipelineActions' const initialState: DisplayData = { timeSeries: {}, heatMap: {}, @@ -554,6 +554,10 @@ export const displayDataSlice = createSlice({ error: action.error.message ?? 'rejected', } }) + .addMatcher( + isAnyOf(run.fulfilled, runByCurrentUid.fulfilled), + (state, action) => initialState, + ) }, }) diff --git a/studio/app/common/core/workflow/workflow_writer.py b/studio/app/common/core/workflow/workflow_writer.py index bebafaf70..1c839844a 100644 --- a/studio/app/common/core/workflow/workflow_writer.py +++ b/studio/app/common/core/workflow/workflow_writer.py @@ -1,4 +1,3 @@ -import os from dataclasses import asdict from typing import Dict @@ -6,7 +5,6 @@ from studio.app.common.core.utils.filepath_creater import join_filepath from studio.app.common.core.workflow.workflow import Edge, Node, WorkflowConfig from studio.app.common.core.workflow.workflow_builder import WorkflowConfigBuilder -from studio.app.common.core.workflow.workflow_reader import WorkflowConfigReader from studio.app.dir_path import DIRPATH @@ -23,23 +21,9 @@ def __init__( self.nodeDict = nodeDict self.edgeDict = edgeDict self.builder = WorkflowConfigBuilder() + self.create_config() def write(self) -> None: - config_filepath = join_filepath( - [ - DIRPATH.OUTPUT_DIR, - self.workspace_id, - self.unique_id, - DIRPATH.WORKFLOW_YML, - ] - ) - - if os.path.exists(config_filepath): - config = WorkflowConfigReader.read(config_filepath) - self.builder.set_config(config) - else: - self.create_config() - ConfigWriter.write( dirname=join_filepath( [DIRPATH.OUTPUT_DIR, self.workspace_id, self.unique_id]