Skip to content

Commit

Permalink
[KED-876] Show example of node tagging in User Guide (kedro-org#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenaBalanQB authored Jul 19, 2019
1 parent c9c49e0 commit f962f67
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/source/04_user_guide/05_nodes_and_pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ There is a special syntax for describing function inputs and outputs. This allow

Any combinations of the above are possible, except nodes of the form `node(f, None, None)` (at least a single input or output needs to be provided).

## Tagging nodes

To tag a node, you can simply specify the `tag` argument, as follows:

```python
node(func=add, inputs=["a", "b"], outputs="sum", name="adding_a_and_b", tag="node_tag")
```

Moreover, you can [tag all nodes in a ``Pipeline``](./05_nodes_and_pipelines.md#tagging-pipeline-nodes).


## Running nodes

To run a node, you need to instantiate its inputs. In this case, the node expects two inputs:
Expand Down Expand Up @@ -259,6 +270,16 @@ Outputs: v
##################################
```

### Tagging pipeline nodes

You can specify a `name` for your ``Pipeline``, which will be used to tag all of the pipeline's nodes.

```python
pipeline = Pipeline([node(..., name="node1"), node(..., name="node2", tag="node_tag")], name="pipeline_tag")
```

Node `node1` will only be tagged with `pipeline_tag`, while `node2` will have both `node_tag` and `pipeline_tag`.

### Merging pipelines

You can merge multiple pipelines as shown below. Note that, in this case, `pipeline_de` and `pipeline_ds` are expanded to a list of their underlying nodes of nodes which are simply merged together:
Expand Down

0 comments on commit f962f67

Please sign in to comment.