Skip to content

Commit

Permalink
add docs (#4019)
Browse files Browse the repository at this point in the history
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
  • Loading branch information
noklam authored Aug 5, 2024
1 parent 94ae223 commit bdb4e24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/nodes_and_pipelines/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ A syntax describes function inputs and outputs. This syntax allows different Pyt
| `None` | No input | `def f()` | `f()` |
| `'a'` | Single input | `def f(arg1)` | `f(a)` |
| `['a', 'b']` | Multiple inputs | `def f(arg1, arg2)` | `f(a, b)` |
| `['a', 'b', 'c']` | Variable inputs | `def f(arg1, *args)`. | `f(arg1, arg2, arg3)` |
| `dict(arg1='x', arg2='y')` | Keyword inputs | `def f(arg1, arg2)` | `f(arg1=x, arg2=y)` |

### Syntax for output variables
Expand All @@ -87,6 +88,9 @@ A syntax describes function inputs and outputs. This syntax allows different Pyt

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

## `*args` node functions
It is common to have functions that take an arbitrary number of inputs, like a function that combines multiple dataframes. You can use the `*args` argument in the node function, while simply declaring the names of the datasets in the node's inputs.

## `**kwargs`-only node functions

Sometimes, when creating reporting nodes for instance, you need to know the names of the datasets that your node receives, but you might not have this information in advance. This can be solved by defining a `**kwargs`-only function:
Expand Down

0 comments on commit bdb4e24

Please sign in to comment.