Replies: 2 comments
-
As per my discussion with @noklam , there are two ways to solve this:
# conf/base/namespace1/sub-namespace1.yaml
namespace1:
sub-namespace1:
key1: value1
# conf/base/namespace1/sub-namespace2.yaml
namespace1:
sub-namespace2:
key2: value2
key3: value3 regarding namespace1 is duplicated. |
Beta Was this translation helpful? Give feedback.
-
Full conversation: https://linen-slack.kedro.org/t/22897367/hey-team-i-am-using-dot-separated-namespacing-in-my-paramete#c1d0c9e0-cc4a-428c-a609-246c9e463702 TL;DR I think the two things mentioned above are separate issues. 1. require change in the internal data structure of the config, 2. is an smaller change, which changes how Kedro validate config (It's a valid config so I think it's a bug fix). There are some value of doing 1, but we should keep that as a separate conversation. Having a nested namespace can potentially simplify config with less nested layer, particular for sub-pipeline(modular pipeline). The downside is that introduce difference between how @puneeter If 2. is good enough for what you need now, feel free to go ahead! |
Beta Was this translation helpful? Give feedback.
-
Description
I am using
.
dot separated namespacing in my parameters files. I supposeOmegaConfigLoader
creates the flat dictionary instead of creating the nested namespace based dictionary. Example:Accessing namespace params becomes a bit difficult when you have a pipeline, sub-pipeline structure:
Parameters:
Accessing the
params:pipeline1
is impossible with current OmegaConfigLoader implementation. I can't even use the following structure in kedro because then I get an error (probably that the param -params:pipeline1
already exists):OmegaConf by default expects a nested dictionary based on namespace but Kedro provides it a flattened dictionary in the above case. A simple conversion from flat -> nested dictionary would do the job.
Context
With this change we:
.
separated namespace params as well.Possible Implementation
A simple conversion from flat -> nested dictionary while doing
OmegaConf.create()
inOmegaConfigLoader
would do the job.Link to discussion: https://kedro-org.slack.com/archives/C03RKP2LW64/p1723193517960259
Linked issue on Omegaconf: omry/omegaconf#1188 (comment)
Beta Was this translation helpful? Give feedback.
All reactions