Skip to content

Commit

Permalink
feat: removing explicit addition of success and fail nodes from yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayvammi committed May 13, 2024
1 parent 43a42e5 commit 7e69abb
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 97 deletions.
4 changes: 0 additions & 4 deletions examples/01-tasks/notebook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,3 @@ dag:
command_type: notebook
command: examples/common/simple_notebook.ipynb # The path is relative to the root of the project.
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/01-tasks/python_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ dag:
type: task
command: examples.common.functions.hello # dotted path to the function.
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/01-tasks/scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ dag:
command_type: shell
command: echo "hello world!!" # The path is relative to the root of the project.
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/01-tasks/stub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ dag:
step 3:
type: stub
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/02-sequential/default_fail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ dag:
step 3:
type: stub # This will never execute
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/02-sequential/on_failure_fail.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ dag:
step_4:
type: stub
next: fail
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/02-sequential/on_failure_succeed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ dag:
step_4:
type: stub
next: success
success:
type: success
fail:
type: fail
6 changes: 1 addition & 5 deletions examples/02-sequential/traversal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ dag:
type: task
command_type: notebook
command: examples/common/simple_notebook.ipynb # The path is relative to the root of the project.
next: success
success: # (3)
type: success
fail:
type: fail
next: success # (3)
4 changes: 0 additions & 4 deletions examples/03-parameters/passing_parameters_notebook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ dag:
command_type: notebook
command: examples/common/read_parameters.ipynb
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/03-parameters/passing_parameters_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ dag:
type: task
command: examples.common.functions.read_parameter
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/03-parameters/passing_parameters_shell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,3 @@ dag:
exit 1;
fi
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/03-parameters/static_parameters_non_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,3 @@ dag:
exit 1;
fi
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/03-parameters/static_parameters_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ dag:
type: task
command: examples.common.functions.read_initial_params_as_json
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/04-catalog/catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,3 @@ dag:
rm df.csv || true && \
rm data_folder/data.txt || true
next: success
success:
type: success
fail:
type: fail
12 changes: 0 additions & 12 deletions examples/06-parallel/nesting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ branch: &simple_branch
command_type: notebook
command: examples/common/simple_notebook.ipynb # The path is relative to the root of the project.
next: success
success:
type: success
fail:
type: fail


# This branch is similar to a branch parallel.yaml
Expand All @@ -40,10 +36,6 @@ nested_branch: &nested_branch
branches:
branch1: *simple_branch
branch2: *simple_branch
success:
type: success
failure:
type: fail


# The pipeline of nested parallel branches
Expand All @@ -56,7 +48,3 @@ dag:
branches:
branch1: *nested_branch
branch2: *nested_branch
success:
type: success
failure:
type: fail
8 changes: 0 additions & 8 deletions examples/06-parallel/parallel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ branch: &branch
command_type: notebook
command: examples/common/simple_notebook.ipynb # The path is relative to the root of the project.
next: success
success:
type: success
fail:
type: fail


dag:
Expand All @@ -47,7 +43,3 @@ dag:
branches:
branch1: *branch
branch2: *branch
success:
type: success
failure:
type: fail
8 changes: 0 additions & 8 deletions examples/07-map/custom_reducer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ branch: &branch
type: task
command: examples.common.functions.read_processed_chunk
next: success
success:
type: success
fail:
type: fail

dag:
description: |
Expand Down Expand Up @@ -75,7 +71,3 @@ dag:
type: task
command: examples.common.functions.assert_custom_reducer
next: success
success:
type: success
fail:
type: fail
8 changes: 0 additions & 8 deletions examples/07-map/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ branch: &branch
type: task
command: examples.common.functions.read_processed_chunk
next: success
success:
type: success
fail:
type: fail


dag:
Expand Down Expand Up @@ -76,7 +72,3 @@ dag:
type: task
command: examples.common.functions.assert_default_reducer
next: success
success:
type: success
fail:
type: fail
4 changes: 0 additions & 4 deletions examples/09-retry/python_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,3 @@ dag:
type: task
command: examples.common.functions.read_initial_params_as_json
next: success
success:
type: success
fail:
type: fail
2 changes: 2 additions & 0 deletions runnable/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ def create_graph(dag_config: Dict[str, Any], internal_branch_name: str = "") ->
node = create_node(name, step_config=step_config, internal_branch_name=internal_branch_name)
graph.add_node(node)

graph.add_terminal_nodes(internal_branch_name=internal_branch_name)

graph.check_graph()

return graph
Expand Down

0 comments on commit 7e69abb

Please sign in to comment.