Join the Kedro community

Updated 2 months ago

Can I Pass a Value Directly to a Node Function Without Config?

At a glance

The community member is asking if there is a way to directly pass a value to a function used in a node, without defining it in a config file. The comments suggest using functools.partial as a canonical way to do this, and also mention using "run-time params" and passing it as a MemoryDataset. One community member hoped for a more elegant solution like "const:value", while another mentioned using kedro run --params=param_key1=value1,param_key2=2.0. However, there is no explicitly marked answer in the comments.

Useful resources

Hi all, is there a way to directly pass a value to a function that I use in a node (i.e. include the value in the parameter `inputs` of the node) without defining it in a config file?

d
R
P
6 comments

So if the params pattern isn’t suitable here the canonical way to do this is with functools.partial

Hi @U07KD4K4B2P, You can also make use of run-time params . Thank you

Thanks. I hoped for a more elegant way - like "const:value".

You can pass it as MemoryDataset too

Is that not what this is ?

kedro run --params=param_key1=value1,param_key2=2.0

Add a reply
Sign up and join the conversation on Slack