Skip to content

Commit

Permalink
fix: correct enum value naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Nov1c444 committed Nov 5, 2024
1 parent 92ec7ae commit cbf6c77
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions api/core/workflow/nodes/iteration/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


class ErrorHandleMode(str, Enum):
TERMINATED = "Terminated"
CONTINUE_ON_ERROR = "Continue on error"
REMOVE_ABNORMAL_OUTPUT = "Remove abnormal output"
TERMINATED = "terminated"
CONTINUE_ON_ERROR = "continue-on-error"
REMOVE_ABNORMAL_OUTPUT = "remove-abnormal-output"


class IterationNodeData(BaseIterationNodeData):
Expand Down
9 changes: 5 additions & 4 deletions api/core/workflow/nodes/iteration/iteration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ def _extract_variable_selector_to_variable_mapping(

return variable_mapping

def _handle_event_metadata(self, event: BaseNodeEvent, iter_run_index: str, parallel_mode_run_id: str):
def _handle_event_metadata(
self, event: BaseNodeEvent, iter_run_index: str, parallel_mode_run_id: str
) -> NodeRunStartedEvent | BaseNodeEvent:
"""
add iteration metadata to event.
"""
Expand Down Expand Up @@ -344,7 +346,7 @@ def _run_single_iter(
graph_engine: "GraphEngine",
iteration_graph: Graph,
parallel_mode_run_id: Optional[str] = None,
):
) -> Generator[NodeEvent | InNodeEvent, None, None]:
"""
run single iteration
"""
Expand Down Expand Up @@ -472,7 +474,6 @@ def _run_single_iter(

if next_index < len(iterator_list_value):
variable_pool.add([self.node_id, "item"], iterator_list_value[next_index])

yield IterationRunNextEvent(
iteration_id=self.id,
iteration_node_id=self.node_id,
Expand Down Expand Up @@ -516,7 +517,7 @@ def _run_single_iter_parallel(
iteration_graph: Graph,
index: int,
item: Any,
):
) -> Generator[NodeEvent | InNodeEvent, None, None]:
"""
run single iteration in parallel mode
"""
Expand Down
6 changes: 3 additions & 3 deletions web/app/components/workflow/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export enum ControlMode {
Hand = 'hand',
}
export enum ErrorHandleMode {
Terminated = 'Terminated',
ContinueOnError = 'Continue on error',
RemoveAbnormalOutput = 'Remove abnormal output',
Terminated = 'terminated',
ContinueOnError = 'continue-on-error',
RemoveAbnormalOutput = 'remove-abnormal-output',
}
export type Branch = {
id: string
Expand Down
6 changes: 3 additions & 3 deletions web/i18n/en-US/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@ const translation = {
MaxParallelismDesc: 'The maximum parallelism is used to control the number of tasks executed simultaneously in a single iteration.',
errorResponseMethod: 'Error response method',
ErrorMethod: {
operationTerminated: 'Terminated',
continueOnError: 'Continue on error',
removeAbnormalOutput: 'Remove abnormal output',
operationTerminated: 'terminated',
continueOnError: 'continue-on-error',
removeAbnormalOutput: 'remove-abnormal-output',
},
answerNodeWarningDesc: 'Parallel mode warning: Answer nodes, conversation variable assignments, and persistent read/write operations within iterations may cause exceptions.',
},
Expand Down

0 comments on commit cbf6c77

Please sign in to comment.