Goodmorning, I'm getting new errors using the glob...
# questions
n
Goodmorning, I'm getting new errors using the globals.yml file. The error I get:
Copy code
File "usr/.local/lib/python3.10/site-packages/kedro/config/omegaconf_config.py", line 384, in _get_globals_value
    raise InterpolationResolutionError(
omegaconf.errors.InterpolationResolutionError: Globals key 'SENSOR' not found and no default value provided.
    full_key: preprocessing.targets
    object_type=dict
My kedro version is: 0.19.6 My globals file is:
Copy code
# Sensor Configurations
SENSOR: "XYWF"
Inside my catalog.yml I'm calling this variable as:
Copy code
table:
  type: type: pandas.CSVDataset
  filepath: "data/${globals:SENSOR}/01_raw/company/cars.csv"
m
1. Where is your globals file located? 2. Do you have some customization for config loader in
settings.py
?
n
It’s located in conf/local. I didn’t change the settings.py. Should I change it?
Sorry, I said something wrong. The error is the parameters.yml file. In particular it raising the error for this metadata: Parameters.yml process: target: “{globals:SENSOR}” InterpolationResolutionError: globals key “SENSOR” not found and no default value provided. Full_key: process.target Object type: dict
m
Is it in
conf/local/globals.yml
?
a
I think it might be that your
settings.py
is missing this bit -
Copy code
CONFIG_LOADER_ARGS = {
      "base_env": "base",
      "default_run_env": "local",
}
This was a change from 0.18 to 0.19
n
Yes, it’s in that folder.
I have these configurations in my settings.py. There is something more that I need to check?
m
What if you move
globals.yml
to
conf/base/globals.yml
?
n
Same error.
I moved it outside in conf/ and it works. Maybe there is something to set in the settings.py?
m
@Ankita Katiyar? 👀
a
Ooh that’s quite strange. Could you share what’s in your settings.py?
n
Copy code
this is my settings.py

"""Project settings. There is no need to edit this file unless you want to change values
from the Kedro defaults. For further information, including these default values, see
<https://docs.kedro.org/en/stable/kedro_project_setup/settings.html|https://docs.kedro.org/en/stable/kedro_project_setup/settings.html>."""

# Instantiated project hooks.
from adviser.hooks import (
    SparkHooks,
    PDBNodeDebugHook,
    PDBPipelineDebugHook,
)  # noqa: E402

# Hooks are executed in a Last-In-First-Out (LIFO) order.
HOOKS = (SparkHooks(),PDBNodeDebugHook(),PDBPipelineDebugHook())

# Installed plugins for which to disable hook auto-registration.
# DISABLE_HOOKS_FOR_PLUGINS = ("kedro-viz",)

from pathlib import Path  # noqa: E402

from kedro_viz.integrations.kedro.sqlite_store import SQLiteStore  # noqa: E402

# Class that manages storing KedroSession data.

SESSION_STORE_CLASS = SQLiteStore
# Keyword arguments to pass to the `SESSION_STORE_CLASS` constructor.
SESSION_STORE_ARGS = {"path": str(Path(__file__).parents[2])}

# Directory that holds configuration.
CONF_SOURCE = "conf"

# Class that manages how configuration is loaded.
from kedro.config import OmegaConfigLoader  # noqa: E402

CONFIG_LOADER_CLASS = OmegaConfigLoader
# Keyword arguments to pass to the `CONFIG_LOADER_CLASS` constructor.
CONFIG_LOADER_ARGS = {
    "base_env": "base",
    "default_run_env": "local",
    "config_patterns": {
        "spark": ["spark*", "spark*/**"],
    }
}

# Class that manages Kedro's library components.
# from kedro.framework.context import KedroContext
# CONTEXT_CLASS = KedroContext

# Class that manages the Data Catalog.
# from <http://kedro.io|kedro.io> import DataCatalog
# DATA_CATALOG_CLASS = DataCatalog