Repository: kedro-org/kedro

Issue:
Revert all special conversion logic in `OmegaConfigLoader` for `DictConfig`
## Description
Short description of the problem here.

> This is nearly there but I think there's a bug with it unless I'm missing something: what happens if you have a single `parameters.yml` file and want to use `runtime_params`?
> 
> As part of a separate PR I think we should revert #2378 (but keep `test_no_DictConfig_in_store` as it's a good regression test) and #2176.

As part of the conversation in #2467, we should revert the changes that we added in #2378 and #2176 as we no longer need to deal with the special `DictConfig` object. Historically we need that because OmegaConfigLoader return DictConfig instead of a primitive `Dict`.

We also need to keep the test to make sure there is no regression and #2357 will not happen again.

## Context
How has this bug affected you? What were you trying to accomplish?



Discussion:

Resolving patch:
diff --git a/kedro/framework/context/context.py b/kedro/framework/context/context.py
--- a/kedro/framework/context/context.py
+++ b/kedro/framework/context/context.py
@@ -8,7 +8,6 @@
 from urllib.parse import urlparse
 from warnings import warn
 
-from omegaconf import DictConfig
 from pluggy import PluginManager
 
 from kedro.config import ConfigLoader, MissingConfigException
@@ -93,7 +92,6 @@ def _convert_paths_to_absolute_posix(
     conf_keys_with_filepath = ("filename", "filepath", "path")
 
     for conf_key, conf_value in conf_dictionary.items():
-
         # if the conf_value is another dictionary, absolutify its paths first.
         if isinstance(conf_value, dict):
             conf_dictionary[conf_key] = _convert_paths_to_absolute_posix(
@@ -156,9 +154,7 @@ def _update_nested_dict(old_dict: dict[Any, Any], new_dict: dict[Any, Any]) -> N
         if key not in old_dict:
             old_dict[key] = value
         else:
-            if isinstance(old_dict[key], (dict, DictConfig)) and isinstance(
-                value, (dict, DictConfig)
-            ):
+            if isinstance(old_dict[key], dict) and isinstance(value, dict):
                 _update_nested_dict(old_dict[key], value)
             else:
                 old_dict[key] = value
@@ -326,7 +322,7 @@ def _add_param_to_feed_dict(param_name, param_value):
             """
             key = f"params:{param_name}"
             feed_dict[key] = param_value
-            if isinstance(param_value, (dict, DictConfig)):
+            if isinstance(param_value, dict):
                 for key, val in param_value.items():
                     _add_param_to_feed_dict(f"{param_name}.{key}", val)
 
diff --git a/kedro/framework/session/session.py b/kedro/framework/session/session.py
--- a/kedro/framework/session/session.py
+++ b/kedro/framework/session/session.py
@@ -13,7 +13,6 @@
 from typing import Any, Iterable
 
 import click
-from omegaconf import OmegaConf, omegaconf
 
 from kedro import __version__ as kedro_version
 from kedro.config import ConfigLoader, MissingConfigException
@@ -200,8 +199,6 @@ def create(  # pylint: disable=too-many-arguments
 
     def _get_logging_config(self) -> dict[str, Any]:
         logging_config = self._get_config_loader()["logging"]
-        if isinstance(logging_config, omegaconf.DictConfig):
-            logging_config = OmegaConf.to_container(logging_config)  # pragma: no cover
         # turn relative paths in logging config into absolute path
         # before initialising loggers
         logging_config = _convert_paths_to_absolute_posix(


Test patch:
diff --git a/tests/framework/context/test_context.py b/tests/framework/context/test_context.py
--- a/tests/framework/context/test_context.py
+++ b/tests/framework/context/test_context.py
@@ -12,7 +12,6 @@
 import pytest
 import toml
 import yaml
-from omegaconf import OmegaConf
 from pandas.util.testing import assert_frame_equal
 
 from kedro import __version__ as kedro_version
@@ -486,11 +485,6 @@ def test_validate_layers_error(layers, conflicting_datasets, mocker):
             {"a": {"a.c": {"a.c.b": 4}}},
             {"a": {"a.a": 1, "a.b": 2, "a.c": {"a.c.a": 3, "a.c.b": 4}}},
         ),
-        (
-            {"a": OmegaConf.create({"b": 1}), "x": 3},
-            {"a": {"c": 2}},
-            {"a": {"b": 1, "c": 2}, "x": 3},
-        ),
     ],
 )
 def test_update_nested_dict(old_dict: dict, new_dict: dict, expected: dict):