Skip to content

Commit

Permalink
Add deprecation warning for TemplatedConfigLoader and ConfigLoader (
Browse files Browse the repository at this point in the history
#2840)

* Add deprecation warning for TCL and CL

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

* Update release notes, deprecation warning

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>

---------

Signed-off-by: Ankita Katiyar <ankitakatiyar2401@gmail.com>
  • Loading branch information
ankatiyar authored Jul 27, 2023
1 parent acff3e2 commit 3a02aa4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit 3a02aa4

Please sign in to comment.