Fazil Topal
09/13/2024, 12:15 PMsettings.py
CONFIG_LOADER_ARGS = {
"base_env": "base",
"default_run_env": "local",
"config_patterns": {
# Also include models.yml in the catalog
"catalog": [
"catalog*",
"models*",
"catalog*/**",
"models*/**",
"**/catalog*",
"**/models*",
],
}
}
conftest.py
from kedro.framework.project import settings
@fixture(scope='session')
def config_loader():
kwargs = settings.CONFIG_LOADER_ARGS
kwargs.update(env="test", base_env="base", default_run_env="test")
return OmegaConfigLoader(
conf_source=str(PROJECT_PATH / settings.CONF_SOURCE), **kwargs,
)
I expect my settings valued to loaded but this doesnt seem to be the case as I can't get config patters in the dict itself. Any idea why is that?Fazil Topal
09/13/2024, 12:34 PM@fixture(scope='session')
def config_loader():
bootstrap_project(PROJECT_PATH)
kwargs = settings.CONFIG_LOADER_ARGS
kwargs.update(env="test", base_env="base", default_run_env="test")
return OmegaConfigLoader(
conf_source=str(PROJECT_PATH / settings.CONF_SOURCE), **kwargs,
)
adding boostrap_project
makes it work, I guess i have to add thisNok Lam Chan
10/08/2024, 10:15 AMbootstrap_project
to make sure project settings are read (because you are creating the class directly).
Or you can pass in the kwargs explicitly (i.e. passing env=test if you have a separate test env)Fazil Topal
10/16/2024, 11:20 AMenv
but without bootstrap didn't work. That's why i needed to add the bootstrap function