From bdb4e2416a68d9208970c893466efe1439365fe6 Mon Sep 17 00:00:00 2001 From: Nok Lam Chan Date: Mon, 5 Aug 2024 14:42:43 +0100 Subject: [PATCH] add docs (#4019) Signed-off-by: Nok --- docs/source/nodes_and_pipelines/nodes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/nodes_and_pipelines/nodes.md b/docs/source/nodes_and_pipelines/nodes.md index fd602ac8d8..46254918e6 100644 --- a/docs/source/nodes_and_pipelines/nodes.md +++ b/docs/source/nodes_and_pipelines/nodes.md @@ -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 @@ -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: