Fazil Topal
08/07/2024, 5:58 PMconf/base/catalog.yaml
conf/test/catalog.yaml
in the test env, i have same catalog entries but their filepaths are different, I was trying to get the test run using the test
env by loading the corresponding data files. However I am getting the following error:
if duplicates:
dup_str = "\n".join(duplicates)
> raise ValueError(f"{dup_str}")
E ValueError: Duplicate keys found in /home/ftopal/Projects/ss-finder/conf/test/catalog.yml and /home/ftopal/Projects/ss-finder/conf/base/catalog.yml: basics, crew, people...
../../../miniconda3/envs/ss-finder/lib/python3.10/site-packages/kedro/config/omegaconf_config.py:449: ValueError
I thought it would just do destructive merge but something is still off.
here is the test setup:
import pandas as pd
from pytest import fixture
from pathlib import Path
from kedro.config import OmegaConfigLoader
from kedro.framework.context import KedroContext
from kedro.framework.hooks import _create_hook_manager
from kedro.framework.project import settings
PROJECT_PATH = Path.cwd().parent.resolve()
@fixture
def config_loader():
return OmegaConfigLoader(
conf_source=str(PROJECT_PATH / settings.CONF_SOURCE),
env="test",
default_run_env="test"
)
@fixture
def project_context(config_loader):
return KedroContext(
package_name="ss_finder",
project_path=PROJECT_PATH,
config_loader=config_loader,
hook_manager=_create_hook_manager(),
env="test"
)
Fazil Topal
08/07/2024, 6:09 PM@fixture
def config_loader():
return OmegaConfigLoader(
conf_source=str(PROJECT_PATH / settings.CONF_SOURCE),
env="test",
base_env="base",
default_run_env="test"
)
I am not sure if it's intentional that we do base_env=base
to get it working. Documentation of the func says it should default to base
but it actually doesn'tYolan Honoré-Rougé
08/07/2024, 6:49 PMbase_env="."
and default_run_env="."
to ensure it runs with config files at the root when using it in a notebook (see link below 👇)
But in a kedro project it reads the settings.py
where the defaults are "base"
and "local"
so that it runs as in previous kedro versionYolan Honoré-Rougé
08/07/2024, 6:50 PMFazil Topal
08/08/2024, 9:19 AMElias WILLEMSE
08/09/2024, 10:19 PMFazil Topal
08/10/2024, 2:02 PM