Hello, everyone. I need some answers and suggestio...
# questions
o
Hello, everyone. I need some answers and suggestions about the possible solutions described below. I have a structure of the configs where
globals.yml
keys are used in my
.yml
parameters config files for the catalog. So when I change globals I change a catalog config. And I need to have the ability to change the
globals.yml
through
extra_parameters
or another way in code and also using CLI. I had such an ability using TemplateConfigLoader, but now I’ve switched to the OmegaConfigLoader to be up-to-date, but lost this functionality. I found out that I can do this through runtime_parameters since
v0.18.14
. Is it the proper way to do it or it’ll not work and I need something else?
a
You can’t override config in
globals.yml
with
runtime_params:
resolver but what you can do is in your catalog.yml -
Copy code
dataset_name:
  field_to_override: "${runtime_params:key, ${globals:global_key}}"
This will use value from
--params: key=value
otherwise use the globals value from
globals.yml
as default
o
Thanks a lot. But can I change
runtime_params
values in the code?
a
No worries, could you elaborate? What exactly do you want to do?
o
For example I have
dataset_name
key in configs that I want to change from CLI or using Python code, in both ways. First way via CLI you already described, thanks for that, now I'm interested in the second way. I mean that can I run Kedro session and manually set this
dataset_name
key via code?
a
Ah, I believe if you do
KedroSession.create(extra_params={"dataset_name":<new_name>})
the
extra_params
will be used by the
runtime_params:
resolver