Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation warning for TemplatedConfigLoader and ConfigLoader #2840

Merged
merged 4 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
## Breaking changes to the API

## Upcoming deprecations for Kedro 0.19.0
* `ConfigLoader` and `TemplatedConfigLoader` will be deprecated. Please use `OmegaConfigLoader` instead.

# Release 0.18.11

Expand Down
13 changes: 11 additions & 2 deletions kedro/framework/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import subprocess
import sys
import traceback
import warnings
from copy import deepcopy
from pathlib import Path
from typing import Any, Iterable

import click

from kedro import __version__ as kedro_version
from kedro.config import ConfigLoader, MissingConfigException
from kedro.config import ConfigLoader, MissingConfigException, TemplatedConfigLoader
from kedro.framework.context import KedroContext
from kedro.framework.context.context import _convert_paths_to_absolute_posix
from kedro.framework.hooks import _create_hook_manager
Expand Down Expand Up @@ -261,7 +262,15 @@ def load_context(self) -> KedroContext:
env = self.store.get("env")
extra_params = self.store.get("extra_params")
config_loader = self._get_config_loader()

if isinstance(config_loader, (ConfigLoader, TemplatedConfigLoader)):
warnings.warn(
f"{type(config_loader).__name__} will be deprecated in Kedro 0.19."
f" Please use the OmegaConfigLoader instead. To consult"
f" the documentation for OmegaConfigLoader, see here:"
f" https://docs.kedro.org/en/stable/configuration/"
f"advanced_configuration.html#omegaconfigloader",
FutureWarning,
)
context_class = settings.CONTEXT_CLASS
context = context_class(
package_name=self._package_name,
Expand Down