Nicolas P
07/02/2024, 3:03 PMconf/prod/parameters.yml
, Kedro complains about the fact that the's a duplicate (unless we hardcode env ='prod'
in OmegaConfigLoader
I'm sure it's a dummy question, but we couldn't find a way to access the env at runtime. Would you mind pointing us to a way to do so?
Also, what do you think about the design we chose ? Does it follow kedro best practices?
Thx for any pointers!Merel
07/02/2024, 4:07 PMNicolas P
07/02/2024, 4:16 PMTraceback (most recent call last):
line 435, in _check_duplicates
raise ValueError(f"{dup_str}")
ValueError: Duplicate keys found in ****conf/production/parameters.yml and ****/conf/base/parameters.yml: my_key
Nicolas P
07/02/2024, 4:19 PMconf_loader = OmegaConfigLoader(conf_source=conf_path,
env="production",
base_env="base")
Merel
07/02/2024, 4:23 PMsettings.py
?
CONFIG_LOADER_ARGS = {
"base_env": "base",
"default_run_env": "local",
}
Nicolas P
07/02/2024, 4:24 PMsettings.py
CONFIG_LOADER_ARGS = {
"base_env": "base",
"default_run_env": "local",
}
Nicolas P
07/02/2024, 4:24 PMkedro~=0.19.6
Merel
07/02/2024, 4:26 PMconf/base/parameters.yml
my_key: bla
and
conf/production/parameters.yml
my_key: bla
and this works fine. I only get that error if I have the same parameter in files within the same environment..Nicolas P
07/02/2024, 4:28 PMdef create_pipeline(**_kwargs) -> Pipeline:
conf_path = str(settings.CONF_SOURCE)
conf_loader = OmegaConfigLoader(conf_source=conf_path)
content_ids = conf_loader["parameters"]["key]
pipeline(
[
node(
func=parse_content_data,
inputs=f"content_data_{c}",
outputs=f"content_data_{c}_csv",
name=f"parse_content_data_{c}_node"
)
for c in content_ids
])
Merel
07/02/2024, 4:30 PMMerel
07/02/2024, 4:31 PMOmegaConfigLoader
you have to provide the environment there. Usually when using the cli, Kedro will determine the environment properly for you.Nicolas P
07/02/2024, 4:32 PMMerel
07/02/2024, 4:35 PMNicolas P
07/02/2024, 4:39 PMmarrrcin
07/03/2024, 7:29 AMNicolas P
07/03/2024, 10:09 AM