Skip to content

Commit 3a02aa4

Browse files
authored
Add deprecation warning for TemplatedConfigLoader and ConfigLoader (#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>
1 parent acff3e2 commit 3a02aa4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

RELEASE.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
## Breaking changes to the API
2525

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

2829
# Release 0.18.11
2930

kedro/framework/session/session.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
import subprocess
99
import sys
1010
import traceback
11+
import warnings
1112
from copy import deepcopy
1213
from pathlib import Path
1314
from typing import Any, Iterable
1415

1516
import click
1617

1718
from kedro import __version__ as kedro_version
18-
from kedro.config import ConfigLoader, MissingConfigException
19+
from kedro.config import ConfigLoader, MissingConfigException, TemplatedConfigLoader
1920
from kedro.framework.context import KedroContext
2021
from kedro.framework.context.context import _convert_paths_to_absolute_posix
2122
from kedro.framework.hooks import _create_hook_manager
@@ -261,7 +262,15 @@ def load_context(self) -> KedroContext:
261262
env = self.store.get("env")
262263
extra_params = self.store.get("extra_params")
263264
config_loader = self._get_config_loader()
264-
265+
if isinstance(config_loader, (ConfigLoader, TemplatedConfigLoader)):
266+
warnings.warn(
267+
f"{type(config_loader).__name__} will be deprecated in Kedro 0.19."
268+
f" Please use the OmegaConfigLoader instead. To consult"
269+
f" the documentation for OmegaConfigLoader, see here:"
270+
f" https://docs.kedro.org/en/stable/configuration/"
271+
f"advanced_configuration.html#omegaconfigloader",
272+
FutureWarning,
273+
)
265274
context_class = settings.CONTEXT_CLASS
266275
context = context_class(
267276
package_name=self._package_name,

0 commit comments

Comments
 (0)