hey, on kedro, version 0.19.12 whats the best way ...
# questions
g
hey, on kedro, version 0.19.12 whats the best way to use a parameter to overwrite part of the catalog and catalog_globals paths?
g
many thanks @Ankita Katiyar the problem is that I wanted to use a parameter for interpolation into catalog_globals and then into catalog, to be able to use
kedro run --params my_dataset_path=xx
but it doesnt seem to be supported directly? instead i now use
MY_DATASET_PATH=xx kedro run
, after adding this in settings.py
OmegaConf.register_new_resolver("env", lambda var, default=None: os.getenv(var, default))
, which interpolates directly into catalog_globals without a parameter. I would still prefer to use a parameter rather than an envvar if possible, what do you recommend?
a
I think for that you could use
runtime_params:
resolver. https://docs.kedro.org/en/0.19.12/configuration/advanced_configuration.html#how-to-override-configuration-with[…]rameters-with-the-omegaconfigloader Then your catalog entry should look like:
Copy code
my_dataset:
  type: <type>
  filepath: "data/01_raw/${runtime_params:path}"
And you could run with
kedro run --params path=path
g
great, thx