Skip to content Skip to sidebar Skip to footer

How To Pass A Literal Value To A Node?

I've got a function def do_something(input_data, column: int): # Do something with one column of the data Now I need to create a node, but I can't do node(do_something, ['inp

Solution 1:

One approach would be to pass the data via params. Add column_number: 1 to the parameters.yaml file, and then your node definition would look like node(do_somethingm ["input_data", "params:column_number"], "output").

If you need to reuse the same function in many nodes, changing the column, then it will not work easily. Instead you can use partial, something like node(partial(do_comething, column=1), "input_data", "output"])


Post a Comment for "How To Pass A Literal Value To A Node?"