Pedro Sousa Silva
11/12/2024, 5:54 PMOmegaConfigLoader
? My use case is that i want to select a parameter in Databricks Workflows and have it override a kedro param at runtime. I was trying to use a global (in globals.yml), as those can be used in the catalog.yml, but unfortunately they can not be overriden at runtime, according to the docsHall
11/12/2024, 5:54 PMdatajoely
11/12/2024, 5:55 PMPedro Sousa Silva
11/12/2024, 5:58 PMNok Lam Chan
11/12/2024, 6:04 PMPedro Sousa Silva
11/12/2024, 6:10 PMmytable:
catalog: mycatalog
write_mode: overwrite
database: gold_dm_${params:run_folder}
table: mytable
Yolan Honoré-Rougé
11/12/2024, 7:03 PMruntime_params
resolver, identical to globals
but specifically for overriding params at runtimeYolan Honoré-Rougé
11/12/2024, 7:05 PMparams
with `runtime_params`:
mytable:
catalog: mycatalog
write_mode: overwrite
database: gold_dm_${runtime_params:run_folder}
table: mytableace
Abhishek Bhatia
11/13/2024, 7:55 AMruntime_params
. Very useful, especially for changing output folder. But does it also try to find it in globals, or do we have to provide it everytime we run?
Although I am using a custom loader based on TemplatedConfigLoader
in 1 project.
Another simple solution could be the following:
In your main entrypoint script, dump the global parameters needed to be overriden in conf/local/globals.yml
main.py
import os
import yaml
os.makedirs("conf/local", exist_ok=True)
with open("conf/local/globals.yml", "w") as f:
yaml.dump(global_params_to_override)
# Now run your kedro pipeline (assure that local env is default else specify it)
Pedro Sousa Silva
11/13/2024, 10:21 AMruntime_params
either. That solves for my use case entirely! Thank you!datajoely
11/13/2024, 10:21 AMPedro Sousa Silva
11/13/2024, 10:24 AMruntime_params
was right above the one i've linked to in my question, even though I could swear I had read the entire parametrization docs 😅 so i was helpless, the docs are great!datajoely
11/13/2024, 10:25 AMPedro Sousa Silva
11/13/2024, 10:31 AMcatalog.yml
-> regular parameters.yml
and globals.yml
with no custom resolvers
• I need to use parameters in catalog.yml
but will not override them at runtime -> use globals
and resolve them in catalog.yml
(and parameters.yml
, if needed)
• I need to use parameters in catalog.yml
AND will override them at runtime -> use runtime_params
and resolve them in catalog.yml
(and parameters.yml
, if needed)
But to be fair my patterns might be niche and the usage patterns of 90% of kedro users be completely different.datajoely
11/13/2024, 11:21 AM