hey guys, I have a code which has kind of submode...
# questions
f
hey guys, I have a code which has kind of submodels in it. (3 of them) They follow the same naming pattern for execution nodes. The problem is i can't put them all under
default
because names are not unique. Is recommended way to solve this using tags or namespaces? Or do i have to change the names to be unique manually?
d
Namespaces are your friend here!
for this exact problem
f
Cool, will try to use namespaces then ๐Ÿ‘ thankyou
I have the following problem now. Without passing namespaces, i used the following convention in data catalog already:
Copy code
modelA.orders: ...

modelB.orders: ...

modelC.orders: ...

modelA.pipeline: ...

modelB.pipeline: ...

modelC.pipeline: ...
So namespaces (when i pass to
pipeline
function) creates/looks for the following entry in the catalog:
modelA.modelA.orders
which i solve by not being explicit but i have the following function
Copy code
node(
 func: ...
 inputs={
   modelA=modelA.pipeline,
   modelB=modelB.pipeline,
   modelC=modelC.pipeline,
  }
)
How can pass this without being explicit? ๐Ÿค”
d
are you using a dynamic pipeline here?
f
Nope, only 3 models and so far i didn't pass
namespace
anywhere but explicityle created catalog/params with modelA/B/C prefix.
d
okay gotcha
f
I so far invoked individual runs on my machine, for instance just running -p modelA or something
I wonder if tags would just solve it ๐Ÿ˜„
d
we are talking about explicitly adding the namespace to the pipeline piece right?
Copy code
ds_pipeline_1 = pipeline(
    pipe=pipeline_instance,
    inputs="model_input_table",
    namespace="active_modelling_pipeline",
)
f
yes right now I have 3 submodels(a,b,c) and final model takes those submodels so I was referring them explicitly in the node. All catalog/params looks namespaced but python code doesn't refer to namespace param as i did everything manually (wiring)
Adding code piece here for clear reference. That's it is defined now (namespace is not passed anywhere in the code
d
okay namespace is applied at a pipeline level
f
In the pipeline function, im also not passing namespace ๐Ÿ˜„ My catalog I have defs like
drivingTime.modelPipeline#s3
I use kedro.pipeline, don't import it from modular pipeline as well
d
so that method should still have a
namespace=
kwarg?
f
pipeline has param called namespace yes
I first passed but then kedro tries to load
modelA.modelA.orders
so kind of double namespace issue
d
you may have to change your
.
since thatโ€™s somewhat reserved
namespaces are a little tricky to get the hang of, maybe worth running through the tutorial before migrating your existing stuff?
f
I see but you're saying using tags wouldn't solve the issue, it has to be namespaced?