Hello! Is there a way to modify a node’s inputs us...
# questions
f
Hello! Is there a way to modify a node’s inputs using hooks? I’m not sure if this is the best approach, but I need to perform some operations on AWS Personalize using boto3, so my nodes will require the Personalize client as an input. Ideally, I’d like to inject the client rather than initialize it separately within each node.
l
Hi Felipe, Maybe the
before_node_run
hook could be what you're looking for? https://docs.kedro.org/en/1.0.0/extend/hooks/examples/#modify-node-inputs-using-before_node_run-hook I think another option could be writing a custom dataset that returns your boto3 client, so you could declare it as a pipeline input in the data catalog.
f
Thank you! I am going to try with
before_node_run
, I would like to avoid creating a dataset just for the client. I have also explored the option of using partial function as the node
l
Alright, let us know if you have any further questions 😃