is there a way to use same node with different set...
# questions
s
is there a way to use same node with different sets of input/outputs? my_node(a) -> b my_node(c) -> d i think i saw something related in the documentation but i think it looked too complicated , any easy way to do it?
r
I think you need to do this on the level of the pipeline. That would be a modular pipeline, and then you can remap inputs and outputs. See the last example in https://kedro.readthedocs.io/en/stable/nodes_and_pipelines/modular_pipelines.html
🙏 1
kedroid 1
d
Yes exactly @Ricardo Araújo is on the money 💵 !
r
Other than that, you could wrap the same function in different nodes with different inputs/outputs. Not as clean, though.
d
specifically look for the
Using a modular pipeline multiple times
heading
s
yeah i think i saw it and i avoided trying it out because i have issues with the “params:override_me” no idea why… i do pass “params”, but using ‘:’ is not working and i didn’t figure out why
d
Copy code
template_pipeline = pipeline(
    [
        node(
            func=node_func1,
            inputs=["input1", "input2", "params:override_me"],
            outputs="intermediary_output",
        ),
        node(
            func=node_func2,
            inputs="intermediary_output",
            outputs="output",
        ),
    ]
)

alpha_pipeline = pipeline(
    pipe=template_pipeline,
    inputs={"input1", "input2"},
    parameters={"params:override_me": "params:alpha"},
    namespace="alpha",
)

beta_pipeline = pipeline(
    pipe=template_pipeline,
    inputs={"input1", "input2"},
    parameters={"params:override_me": "params:beta"},
    namespace="beta",
)

final_pipeline = alpha_pipeline + beta_pipeline
from the example in there
oh I see you’re saying that’s not working
what is the key you’re looking for in your override, is it nested with
.
or does it have spaces in it?
s
i don’t have an override example written yet, but when i tried passing specific parameters using : i got an error.
d
what was the error?
s
ValueError: Pipeline input(s) {‘params:data_extraction_params’} not found in the DataCatalog which is inside a yml inside the parameters directory
d
have you added a namespace?
s
my usage in main and the settings file
can you explain about the namespace?
d
so this is quite an unusual way of using Kedro, is there a reason you’re not using the standard template and workflow?
it’s possible to get this working, but it’s much harder to support
s
hm i’m not sure i understand the differences between this and the standart template and workflow 🙂
d
if you have time- I’d really encourage you to follow the spaceflights tutorial it even covers this part under this section
👍 2
it should take you through the expected usage pattern
s
i will do that…i feel like i can optimize my kedro usage…. and i need to invest some time just going over the basiscs 🙂 thanks a lot!
d
I also have a video that takes you through some of this, a little outdated but hopefully useful

https://www.youtube.com/watch?v=NU7LmDZGb6E

🙏 1