Hey guys! Quick question, how can I dinamically ad...
# advanced-need-help
m
Hey guys! Quick question, how can I dinamically add the kedro enviroment in my parameters in order to be able to run specific stuff during the pipeline run? Im using kedro 0.18.0
a
Hello! There are a few of ways of doing this. The best way depends a bit on how many environments you have and what exactly you're trying to do. The easiest way is just to manually define in each environment a parameter called
env
and set it to be the environment name. Then pass
params:env
as a node input. If you want to automate this further so you don't need to manually define
env
in the parameters files OR if you want to use the
env
itself in the parameters file then your best bet is to use the TemplatedConfigLoader and then follow one of these approaches: https://github.com/kedro-org/kedro/issues/1411#issuecomment-1088350038
Note if you're using TemplatedConfigLoader you'll need to upgrade to 0.18.1 since there was a bug with it in 0.18.0. This is easy to do: just
pip install -U kedro
m
Ey Antony! Thanks for your answer! I Wwill try the second approach bc we use to have multiples enviroments so that should be the way to go...