Shafiq Ninaba
12/03/2024, 2:11 AMkedro run --conf-source=/path/to/another/conf
to specify another configuration source as stated in the docs. I also have another function that programmatically reads in the configs:
from kedro.config import OmegaConfigLoader
from kedro.framework.project import settings
def read_omegaconfig(
source: str = "catalog",
conf_source: str = settings.CONF_SOURCE,
) -> Dict[str, Any]:
"""Extracts catalog configuration from the conf folder
Args:
source: str
Source of the configuration. e.g. 'catalog' or 'parameters'
conf_source: str
Source of the configuration files. e.g. 'conf'
Returns:
Dict[str, Any]: Configuration dictionary
"""
conf_loader = OmegaConfigLoader(
conf_source=conf_source, base_env="base", default_run_env="local"
)
conf_catalog = conf_loader[source]
return conf_catalog
However, this seems to still be reading the default conf
directory that is defined in settings.CONF_SOURCE
, instead of the new --conf-source
directory. I don't really understand how the CLI's --conf-source
flag works. I thought the CLI flag would have replaced CONF_SOURCE
in the settings somehow. Is there another way to solve the problem that I'm facing? Appreciate any help! Thanks :)Hall
12/03/2024, 2:11 AMYolan Honoré-Rougé
12/03/2024, 7:45 AMShafiq Ninaba
12/03/2024, 8:20 AMnodes.py
and pipeline.py
i run the training loop, but the ModelTrainer
class is defined in another script which reads in a big parameters_model_config.yml
file (which i will then read in via the above function).
i am doing this because i want to avoid passing in a lot of parameters via my pipeline.py
file.
if it's not possible, then is there a way i can find out (in my Python script) what CLI flags were being passed to during kedro run
? thanks.datajoely
12/03/2024, 10:03 AMbefore_pipeline_run
hooks to do thisShafiq Ninaba
12/04/2024, 5:53 AMkedro run --conf-source=/path/to/another/conf
, the whole pipeline will have information on the conf source path.
thanks for the replies so far!Yolan Honoré-Rougé
12/04/2024, 6:49 AM