From 28fa9169a5bca9b4b0721e978f174aa3494a886b Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Wed, 2 Aug 2023 13:00:39 +0100 Subject: [PATCH 01/17] Add migration steps for CL to OCL Signed-off-by: Merel Theisen --- docs/source/configuration/migration.md | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 docs/source/configuration/migration.md diff --git a/docs/source/configuration/migration.md b/docs/source/configuration/migration.md new file mode 100644 index 0000000000..2e18ec7f68 --- /dev/null +++ b/docs/source/configuration/migration.md @@ -0,0 +1,56 @@ +## Migration guide for config loaders +The `ConfigLoader` and `TemplatedConfigLoader` classes are now deprecated and scheduled for removal in Kedro `0.19.0`. To ensure smooth transitions for users, we strongly recommend adopting the [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) promptly. +This migration guide outlines the primary distinctions between the old loaders and the `OmegaConfigLoader`, providing step-by-step instructions on updating your code base to utilise the new class effectively. + +### [`ConfigLoader`](/kedro.config.ConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) + +### 1. Install the Required Library +The [`OmegaConfigLoader`](advanced_configuration.md#omegaconfigloader) was introduced in Kedro `0.18.5` and is based on [OmegaConf](https://omegaconf.readthedocs.io/). In order to use it you need to ensure you have both a version of Kedro of `0.18.5` or above and `omegaconf` installed. +You can install both using `pip`: + +```bash +pip install kedro==0.18.5 +``` +This would be the minimum required Kedro version which includes `omegaconf` as dependency. +Or you can run: +```bash +pip install -U kedro +``` + +This command installs the most recent version of Kedro which also includes `omegaconf` as dependency. + +### 2. Import Statements +Replace the import statement for `ConfigLoader` with the one for `OmegaConfigLoader`: + +```python +# Before: +from kedro.config import ConfigLoader + +# After: +from kedro.config import OmegaConfigLoader +``` + +### 3. File Format Support +`OmegaConfigLoader` supports only `yaml` and `json` file formats. Make sure that all your configuration files are in one of these formats. If you were using other formats with `ConfigLoader`, convert them to `yaml` or `json`. + +### 4. Load Configuration +The method to load the configuration using `OmegaConfigLoader` is slightly updated. The `ConfigLoader` allowed users to access configuration through the `.get()` method, which required patterns as argument. +The `OmegaConfigLoader` requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. + +```python +# Before: +conf_path = str(project_path / settings.CONF_SOURCE) +conf_loader = ConfigLoader(conf_source=conf_path, env="local") +catalog = conf_loader.get("catalog*") + +# After: +conf_path = str(project_path / settings.CONF_SOURCE) +config_loader = OmegaConfigLoader(conf_source=conf_path, env="local") +catalog = config_loader["catalog"] +``` + +In this example, `"catalog"` is the key to the default catalog patterns specified in the `OmegaConfigLoader` class. + +### 5. Exception Handling +* `OmegaConfigLoader` throws a `MissingConfigException` when configuration paths don't exist, rather than the `ValueError` used in `ConfigLoader`. +* In `OmegaConfigLoader`, if there is bad syntax in your configuration files, it will trigger a `ParserError` instead of a `BadConfigException` used in `ConfigLoader`. From 798f60886813b93869f4e13862adb0e6daa9af09 Mon Sep 17 00:00:00 2001 From: Jo Stichbury Date: Wed, 2 Aug 2023 16:50:44 +0100 Subject: [PATCH 02/17] Add new migration guide to index Signed-off-by: Jo Stichbury --- .../configuration/{migration.md => config_loader_migration.md} | 2 +- docs/source/configuration/index.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename docs/source/configuration/{migration.md => config_loader_migration.md} (98%) diff --git a/docs/source/configuration/migration.md b/docs/source/configuration/config_loader_migration.md similarity index 98% rename from docs/source/configuration/migration.md rename to docs/source/configuration/config_loader_migration.md index 2e18ec7f68..9d11928c49 100644 --- a/docs/source/configuration/migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -1,4 +1,4 @@ -## Migration guide for config loaders +# Migration guide for config loaders The `ConfigLoader` and `TemplatedConfigLoader` classes are now deprecated and scheduled for removal in Kedro `0.19.0`. To ensure smooth transitions for users, we strongly recommend adopting the [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) promptly. This migration guide outlines the primary distinctions between the old loaders and the `OmegaConfigLoader`, providing step-by-step instructions on updating your code base to utilise the new class effectively. diff --git a/docs/source/configuration/index.md b/docs/source/configuration/index.md index 3f554e1e91..291a4fbf65 100644 --- a/docs/source/configuration/index.md +++ b/docs/source/configuration/index.md @@ -6,5 +6,6 @@ configuration_basics credentials parameters +config_loader_migration advanced_configuration ``` From c2d3c8e9f1b912a1413131e7729cd3058ea57b72 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Thu, 3 Aug 2023 16:54:15 +0100 Subject: [PATCH 03/17] Address review comments Signed-off-by: Merel Theisen --- .../configuration/config_loader_migration.md | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 9d11928c49..01d6eb917f 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -1,8 +1,8 @@ # Migration guide for config loaders -The `ConfigLoader` and `TemplatedConfigLoader` classes are now deprecated and scheduled for removal in Kedro `0.19.0`. To ensure smooth transitions for users, we strongly recommend adopting the [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) promptly. +The `ConfigLoader` and `TemplatedConfigLoader` classes have been deprecated since Kedro `0.18.12` and will be removed in Kedro `0.19.0`. To ensure a smooth transition, we strongly recommend you adopt the [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) as soon as possible. This migration guide outlines the primary distinctions between the old loaders and the `OmegaConfigLoader`, providing step-by-step instructions on updating your code base to utilise the new class effectively. -### [`ConfigLoader`](/kedro.config.ConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) +## [`ConfigLoader`](/kedro.config.ConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) ### 1. Install the Required Library The [`OmegaConfigLoader`](advanced_configuration.md#omegaconfigloader) was introduced in Kedro `0.18.5` and is based on [OmegaConf](https://omegaconf.readthedocs.io/). In order to use it you need to ensure you have both a version of Kedro of `0.18.5` or above and `omegaconf` installed. @@ -19,7 +19,16 @@ pip install -U kedro This command installs the most recent version of Kedro which also includes `omegaconf` as dependency. -### 2. Import Statements +### 2. Use the `OmegaConfigLoader` +To use `OmegaConfigLoader` in your project, set the `CONFIG_LOADER_CLASS` constant in your [`src//settings.py`](../kedro_project_setup/settings.md): + +```python +from kedro.config import OmegaConfigLoader # new import + +CONFIG_LOADER_CLASS = OmegaConfigLoader +``` + +### 3. Import Statements Replace the import statement for `ConfigLoader` with the one for `OmegaConfigLoader`: ```python @@ -30,12 +39,12 @@ from kedro.config import ConfigLoader from kedro.config import OmegaConfigLoader ``` -### 3. File Format Support +### 4. File Format Support `OmegaConfigLoader` supports only `yaml` and `json` file formats. Make sure that all your configuration files are in one of these formats. If you were using other formats with `ConfigLoader`, convert them to `yaml` or `json`. -### 4. Load Configuration -The method to load the configuration using `OmegaConfigLoader` is slightly updated. The `ConfigLoader` allowed users to access configuration through the `.get()` method, which required patterns as argument. -The `OmegaConfigLoader` requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. +### 5. Load Configuration +The method to load the configuration using `OmegaConfigLoader` differs slightly from that used by `ConfigLoader`, which allowed users to access configuration through the `.get()` method and required patterns as argument. +When you migrate to use `OmegaConfigLoader`it requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. ```python # Before: @@ -51,6 +60,6 @@ catalog = config_loader["catalog"] In this example, `"catalog"` is the key to the default catalog patterns specified in the `OmegaConfigLoader` class. -### 5. Exception Handling +### 6. Exception Handling * `OmegaConfigLoader` throws a `MissingConfigException` when configuration paths don't exist, rather than the `ValueError` used in `ConfigLoader`. * In `OmegaConfigLoader`, if there is bad syntax in your configuration files, it will trigger a `ParserError` instead of a `BadConfigException` used in `ConfigLoader`. From bd624f96dd232dce9e1227358529762510fdd8f1 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Fri, 4 Aug 2023 11:01:59 +0100 Subject: [PATCH 04/17] Try diff highlighting Signed-off-by: Merel Theisen --- .../configuration/config_loader_migration.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 01d6eb917f..68a7cfd307 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -22,21 +22,19 @@ This command installs the most recent version of Kedro which also includes `omeg ### 2. Use the `OmegaConfigLoader` To use `OmegaConfigLoader` in your project, set the `CONFIG_LOADER_CLASS` constant in your [`src//settings.py`](../kedro_project_setup/settings.md): -```python -from kedro.config import OmegaConfigLoader # new import +```diff ++ from kedro.config import OmegaConfigLoader # new import -CONFIG_LOADER_CLASS = OmegaConfigLoader ++ CONFIG_LOADER_CLASS = OmegaConfigLoader ``` ### 3. Import Statements Replace the import statement for `ConfigLoader` with the one for `OmegaConfigLoader`: -```python -# Before: -from kedro.config import ConfigLoader +```diff +- from kedro.config import ConfigLoader -# After: -from kedro.config import OmegaConfigLoader ++ from kedro.config import OmegaConfigLoader ``` ### 4. File Format Support From 1e8b76c05e1d0b582381a5f6ba5e12f1e9b36c99 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Fri, 4 Aug 2023 11:08:06 +0100 Subject: [PATCH 05/17] Add diff highlight to all examples Signed-off-by: Merel Theisen --- .../configuration/config_loader_migration.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 68a7cfd307..1cd83feb2e 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -44,16 +44,14 @@ Replace the import statement for `ConfigLoader` with the one for `OmegaConfigLoa The method to load the configuration using `OmegaConfigLoader` differs slightly from that used by `ConfigLoader`, which allowed users to access configuration through the `.get()` method and required patterns as argument. When you migrate to use `OmegaConfigLoader`it requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. -```python -# Before: -conf_path = str(project_path / settings.CONF_SOURCE) -conf_loader = ConfigLoader(conf_source=conf_path, env="local") -catalog = conf_loader.get("catalog*") - -# After: -conf_path = str(project_path / settings.CONF_SOURCE) -config_loader = OmegaConfigLoader(conf_source=conf_path, env="local") -catalog = config_loader["catalog"] +```diff +- conf_path = str(project_path / settings.CONF_SOURCE) +- conf_loader = ConfigLoader(conf_source=conf_path, env="local") +- catalog = conf_loader.get("catalog*") + ++ conf_path = str(project_path / settings.CONF_SOURCE) ++ config_loader = OmegaConfigLoader(conf_source=conf_path, env="local") ++ catalog = config_loader["catalog"] ``` In this example, `"catalog"` is the key to the default catalog patterns specified in the `OmegaConfigLoader` class. From 5a6fa502b3acf0ad5cc5fb2bdd5bf5c15a6c99c4 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Mon, 7 Aug 2023 16:11:25 +0100 Subject: [PATCH 06/17] Add migration steps for TCL to OCL Signed-off-by: Merel Theisen --- .../configuration/config_loader_migration.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 1cd83feb2e..56dd25da12 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -59,3 +59,128 @@ In this example, `"catalog"` is the key to the default catalog patterns specifie ### 6. Exception Handling * `OmegaConfigLoader` throws a `MissingConfigException` when configuration paths don't exist, rather than the `ValueError` used in `ConfigLoader`. * In `OmegaConfigLoader`, if there is bad syntax in your configuration files, it will trigger a `ParserError` instead of a `BadConfigException` used in `ConfigLoader`. + + +## [`TemplatedConfigLoader`](/kedro.config.ConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) + +### 1. Install the Required Library +The [`OmegaConfigLoader`](advanced_configuration.md#omegaconfigloader) was introduced in Kedro `0.18.5` and is based on [OmegaConf](https://omegaconf.readthedocs.io/). Features that replace `TemplatedConfigLoader` functionality have been released in later versions, so we recommend users +to install at least Kedro version `0.18.X` to properly replace the `TemplatedConfigLoader` with `OmegaConfigLoader`. +You can install both this Kedro version and `omegaconf` using `pip`: + +```bash +pip install kedro==0.18.X +``` +This would be the minimum required Kedro version which includes `omegaconf` as dependency and the necessary functionality to replace `TemplatedConfigLoader`. +Or you can run: +```bash +pip install -U kedro +``` + +This command installs the most recent version of Kedro which also includes `omegaconf` as dependency. + +### 2. Use the `OmegaConfigLoader` +To use `OmegaConfigLoader` in your project, set the `CONFIG_LOADER_CLASS` constant in your [`src//settings.py`](../kedro_project_setup/settings.md): + +```diff ++ from kedro.config import OmegaConfigLoader # new import + ++ CONFIG_LOADER_CLASS = OmegaConfigLoader +``` + +### 3. Import Statements +Replace the import statement for `TemplatedConfigLoader` with the one for `OmegaConfigLoader`: + +```diff +- from kedro.config import TemplatedConfigLoader + ++ from kedro.config import OmegaConfigLoader +``` + +### 4. File Format Support +`OmegaConfigLoader` supports only `yaml` and `json` file formats. Make sure that all your configuration files are in one of these formats. If you were using other formats with `TemplatedConfigLoader`, convert them to `yaml` or `json`. + +### 5. Load Configuration +The method to load the configuration using `OmegaConfigLoader` differs slightly from that used by `TemplatedConfigLoader`, which allowed users to access configuration through the `.get()` method and required patterns as argument. +When you migrate to use `OmegaConfigLoader`it requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. + +```diff +- conf_path = str(project_path / settings.CONF_SOURCE) +- conf_loader = TemplatedConfigLoader(conf_source=conf_path, env="local") +- catalog = conf_loader.get("catalog*") + ++ conf_path = str(project_path / settings.CONF_SOURCE) ++ config_loader = OmegaConfigLoader(conf_source=conf_path, env="local") ++ catalog = config_loader["catalog"] +``` + +In this example, `"catalog"` is the key to the default catalog patterns specified in the `OmegaConfigLoader` class. + +### 6. Templating of Values +Templating of values is done through [variable interpolation in `OmegaConfigLoader`](advanced_configuration.md#how-to-do-templating-with-the-omegaconfigloader). Where in `TemplatedConfigLoader` it was necessary to +provide the template values in a `globals` file or dictionary, in `OmegaConfigLoader` you can provide these values within the same file that has the placeholders or a file that has a name that follows [the same config pattern specified](configuration_basics.md#configuration-patterns). + +Suppose you are migrating a templated **catalog** file from using `TemplatedConfigLoader` to `OmegaConfigLoader` you would do the following: +1. Rename `conf/base/globals.yml` to match the patterns specified for catalog (`["catalog*", "catalog*/**", "**/catalog*"]`), e.g. `conf/base/catalog_globals.yml` +2. Add an underscore `_` to any catalog template values. This is needed because of how catalog entries are validated. + +```diff +- bucket_name: "my_s3_bucket" +- key_prefix: "my/key/prefix/" + ++ _bucket_name: "my_s3_bucket" ++ _key_prefix: "my/key/prefix/" + +- datasets: +- csv: "pandas.CSVDataSet" +- spark: "spark.SparkDataSet" + ++ _datasets: ++ csv: "pandas.CSVDataSet" ++ spark: "spark.SparkDataSet" +``` + +3. Update `catalog.yml` with the underscores `_` at the beginning of the templated value names. +```diff +- raw_boat_data: +- type: "${_datasets.spark}" +- filepath: "s3a://${_bucket_name}/${_key_prefix}/raw/boats.csv" +- file_format: parquet + ++ raw_boat_data: ++ type: "${_datasets.spark}" ++ filepath: "s3a://${_bucket_name}/${_key_prefix}/raw/boats.csv" ++ file_format: parquet + +- raw_car_data: +- type: "${_datasets.csv}" +- filepath: "s3://${_bucket_name}/data/${_key_prefix}/raw/cars.csv" + ++ raw_car_data: ++ type: "${_datasets.csv}" ++ filepath: "s3://${_bucket_name}/data/${_key_prefix}/raw/cars.csv" +``` + +#### Providing default values for templates with `oc.select` +To provide a default for any template values you have to use [the omegaconf `oc.select` resolver](https://omegaconf.readthedocs.io/en/latest/custom_resolvers.html#oc-select). + +```diff +boats: + users: + - fred +- - "${write_only_user|ron}" ++ - "${oc.select:write_only_user,ron}" +``` + +### 7. Globals +* Globals for OCL: + * 1. within the same config params and catalog (add underscore for catalog) + * 2. between config + * Only globals through file not through dict + * Mix of config level and between config ? + +### 8. Jinja2 +`OmegaConfigLoader` does not support Jinja2 syntax. + +### 9. Exception Handling +* For missing template value throws `OmegaConfigLoader` throws `omegaconf.errors.InterpolationKeyError`. From 47f22f5b8a275ba520868ce6de849ca2b44b9e45 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Mon, 7 Aug 2023 16:24:48 +0100 Subject: [PATCH 07/17] Add Jinja2 migration example and improve diff highlighting Signed-off-by: Merel Theisen --- .../configuration/config_loader_migration.md | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 56dd25da12..b9c8a0a528 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -61,7 +61,7 @@ In this example, `"catalog"` is the key to the default catalog patterns specifie * In `OmegaConfigLoader`, if there is bad syntax in your configuration files, it will trigger a `ParserError` instead of a `BadConfigException` used in `ConfigLoader`. -## [`TemplatedConfigLoader`](/kedro.config.ConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) +## [`TemplatedConfigLoader`](/kedro.config.TemplatedConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) ### 1. Install the Required Library The [`OmegaConfigLoader`](advanced_configuration.md#omegaconfigloader) was introduced in Kedro `0.18.5` and is based on [OmegaConf](https://omegaconf.readthedocs.io/). Features that replace `TemplatedConfigLoader` functionality have been released in later versions, so we recommend users @@ -126,38 +126,30 @@ Suppose you are migrating a templated **catalog** file from using `TemplatedConf ```diff - bucket_name: "my_s3_bucket" -- key_prefix: "my/key/prefix/" - + _bucket_name: "my_s3_bucket" +- key_prefix: "my/key/prefix/" + _key_prefix: "my/key/prefix/" - datasets: -- csv: "pandas.CSVDataSet" -- spark: "spark.SparkDataSet" - + _datasets: -+ csv: "pandas.CSVDataSet" -+ spark: "spark.SparkDataSet" + csv: "pandas.CSVDataSet" + spark: "spark.SparkDataSet" + ``` 3. Update `catalog.yml` with the underscores `_` at the beginning of the templated value names. ```diff -- raw_boat_data: -- type: "${_datasets.spark}" -- filepath: "s3a://${_bucket_name}/${_key_prefix}/raw/boats.csv" -- file_format: parquet - -+ raw_boat_data: -+ type: "${_datasets.spark}" -+ filepath: "s3a://${_bucket_name}/${_key_prefix}/raw/boats.csv" -+ file_format: parquet - -- raw_car_data: -- type: "${_datasets.csv}" -- filepath: "s3://${_bucket_name}/data/${_key_prefix}/raw/cars.csv" - -+ raw_car_data: +raw_boat_data: +- type: "${datasets.spark}" ++ type: "${_datasets.spark}" +- filepath: "s3a://${bucket_name}/${key_prefix}/raw/boats.csv" ++ filepath: "s3a://${_bucket_name}/${_key_prefix}/raw/boats.csv" + file_format: parquet + +raw_car_data: +- type: "${datasets.csv}" + type: "${_datasets.csv}" +- filepath: "s3://${bucket_name}/data/${key_prefix}/raw/cars.csv" + filepath: "s3://${_bucket_name}/data/${_key_prefix}/raw/cars.csv" ``` @@ -180,7 +172,26 @@ boats: * Mix of config level and between config ? ### 8. Jinja2 -`OmegaConfigLoader` does not support Jinja2 syntax. +`OmegaConfigLoader` does not support Jinja2 syntax in configuration. However, users can achieve similar functionality with the `OmegaConfigLoader` in combination with [dataset factories](../data/data_catalog.md#load-multiple-datasets-with-similar-configuration-using-dataset-factories). +If you take the example from [the `TemplatedConfigLoader` with Jinja2 documentation](advanced_configuration.md#how-to-use-jinja2-syntax-in-configuration) you can rewrite your configuration as follows to work with `OmegaConfigLoader`: + +```diff +# catalog.yml +- {% for speed in ['fast', 'slow'] %} +- {{ speed }}-trains: ++ "{speed}-trains": + type: MemoryDataSet + +- {{ speed }}-cars: ++ "{speed}-cars": + type: pandas.CSVDataSet +- filepath: s3://${bucket_name}/{{ speed }}-cars.csv ++ filepath: s3://${bucket_name}/{speed}-cars.csv + save_args: + index: true + +- {% endfor %} +``` ### 9. Exception Handling -* For missing template value throws `OmegaConfigLoader` throws `omegaconf.errors.InterpolationKeyError`. +* For missing template values `OmegaConfigLoader` throws `omegaconf.errors.InterpolationKeyError`. From 092553779a037d72459bd96946a3324d83081f09 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Tue, 8 Aug 2023 17:19:46 +0100 Subject: [PATCH 08/17] Fix merge conflicts Signed-off-by: Merel Theisen --- docs/source/configuration/config_loader_migration.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 58b9a78a18..e3ad671973 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -60,9 +60,6 @@ In this example, `"catalog"` is the key to the default catalog patterns specifie For error and exception handling, most errors are the same. Those you need to be aware of that are different between the original `ConfigLoader` and `OmegaConfigLoader` are as follows: * `OmegaConfigLoader` throws a `MissingConfigException` when configuration paths don't exist, rather than the `ValueError` used in `ConfigLoader`. * In `OmegaConfigLoader`, if there is bad syntax in your configuration files, it will trigger a `ParserError` instead of a `BadConfigException` used in `ConfigLoader`. -* `OmegaConfigLoader` throws a `MissingConfigException` when configuration paths don't exist, rather than the `ValueError` used in `ConfigLoader`. -* In `OmegaConfigLoader`, if there is bad syntax in your configuration files, it will trigger a `ParserError` instead of a `BadConfigException` used in `ConfigLoader`. - ## [`TemplatedConfigLoader`](/kedro.config.TemplatedConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) @@ -74,13 +71,13 @@ You can install both this Kedro version and `omegaconf` using `pip`: ```bash pip install kedro==0.18.X ``` -This would be the minimum required Kedro version which includes `omegaconf` as dependency and the necessary functionality to replace `TemplatedConfigLoader`. +This would be the minimum required Kedro version which includes `omegaconf` as a dependency and the necessary functionality to replace `TemplatedConfigLoader`. Or you can run: ```bash pip install -U kedro ``` -This command installs the most recent version of Kedro which also includes `omegaconf` as dependency. +This command installs the most recent version of Kedro which also includes `omegaconf` as a dependency. ### 2. Use the `OmegaConfigLoader` To use `OmegaConfigLoader` in your project, set the `CONFIG_LOADER_CLASS` constant in your [`src//settings.py`](../kedro_project_setup/settings.md): @@ -105,7 +102,7 @@ Replace the import statement for `TemplatedConfigLoader` with the one for `Omega ### 5. Load Configuration The method to load the configuration using `OmegaConfigLoader` differs slightly from that used by `TemplatedConfigLoader`, which allowed users to access configuration through the `.get()` method and required patterns as argument. -When you migrate to use `OmegaConfigLoader`it requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. +When you migrate to use `OmegaConfigLoader` it requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. ```diff - conf_path = str(project_path / settings.CONF_SOURCE) @@ -197,4 +194,5 @@ If you take the example from [the `TemplatedConfigLoader` with Jinja2 documentat ``` ### 9. Exception Handling +For error and exception handling, most errors are the same. Those you need to be aware of that are different between the original `TemplatedConfigLoader` and `OmegaConfigLoader` are as follows: * For missing template values `OmegaConfigLoader` throws `omegaconf.errors.InterpolationKeyError`. From c3597522643ccf10dadb51c6c957cbef72f7bbf2 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Fri, 18 Aug 2023 10:41:43 +0200 Subject: [PATCH 09/17] Add section on globals for OCL Signed-off-by: Merel Theisen --- .../configuration/config_loader_migration.md | 48 +++++++++++++++++-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index e3ad671973..460044d458 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -165,11 +165,49 @@ boats: ``` ### 7. Globals -* Globals for OCL: - * 1. within the same config params and catalog (add underscore for catalog) - * 2. between config - * Only globals through file not through dict - * Mix of config level and between config ? +If you want to share variables across configuration types, e.g. parameters and catalog, and environments you need to use [the custom globals resolver with the `OmegaConfigLoader`](...). +The `OmegaConfigLoader` requires global values to be provided in a `globals.yml` file. The following section explains the differences between using globals with `TemplatedConfigLoader` and the `OmegaConfigLoader`. + +Let's assume your project contains a `conf/base/globals.yml` file with the following contents: + +```yaml +bucket_name: "my_s3_bucket" +key_prefix: "my/key/prefix/" + +datasets: + csv: "pandas.CSVDataSet" + spark: "spark.SparkDataSet" + +folders: + raw: "01_raw" + int: "02_intermediate" + pri: "03_primary" + fea: "04_feature" +``` + +You no longer need to set `CONFIG_LOADER_ARGS` variable in [`src//settings.py`](../kedro_project_setup/settings.md) to find this `globals.yml` file, because the +`OmegaConfigLoader` is configured to pick up files named `globals.yml` by default. + +```diff +- CONFIG_LOADER_ARGS = {"globals_pattern": "*globals.yml"} +``` + +The globals templating in your catalog configuration will need to be updated to use the globals resolver as follows: + +```diff +raw_boat_data: +- type: "${datasets.spark}" # nested paths into global dict are allowed ++ type: "${globals:datasets.spark}" # nested paths into global dict are allowed +- filepath: "s3a://${bucket_name}/${key_prefix}/${folders.raw}/boats.csv" ++ filepath: "s3a://${globals:bucket_name}/${globals:key_prefix}/${globals:folders.raw}/boats.csv" + file_format: parquet + +raw_car_data: +- type: "${datasets.csv}" ++ type: "${globals:datasets.csv}" +- filepath: "s3://${bucket_name}/data/${key_prefix}/${folders.raw}/${filename|cars.csv}" # default to 'cars.csv' if the 'filename' key is not found in the global dict ++ filepath: "s3://${globals:bucket_name}/data/${globals:key_prefix}/${globals:folders.raw}/${globals:${oc.select:filename|cars.csv}}" # default to 'cars.csv' if the 'filename' key is not found in the global dict +``` ### 8. Jinja2 `OmegaConfigLoader` does not support Jinja2 syntax in configuration. However, users can achieve similar functionality with the `OmegaConfigLoader` in combination with [dataset factories](../data/data_catalog.md#load-multiple-datasets-with-similar-configuration-using-dataset-factories). From da4f432e4c4d2183a647449198690a57cf315875 Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:01:34 +0100 Subject: [PATCH 10/17] Apply suggestions from code review Co-authored-by: Joel <35801847+datajoely@users.noreply.github.com> --- docs/source/configuration/config_loader_migration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 460044d458..e9d9aa00b4 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -111,13 +111,13 @@ When you migrate to use `OmegaConfigLoader` it requires you to fetch configurat + conf_path = str(project_path / settings.CONF_SOURCE) + config_loader = OmegaConfigLoader(conf_source=conf_path, env="local") -+ catalog = config_loader["catalog"] ++ catalog = config_loader["catalog"] # note the key accessor syntax ``` -In this example, `"catalog"` is the key to the default catalog patterns specified in the `OmegaConfigLoader` class. +In this example, the `"catalog"` key points to the default catalog patterns specified in the `OmegaConfigLoader` class. ### 6. Templating of Values -Templating of values is done through [variable interpolation in `OmegaConfigLoader`](advanced_configuration.md#how-to-do-templating-with-the-omegaconfigloader). Where in `TemplatedConfigLoader` it was necessary to +Templating of values is done through native [variable interpolation in `OmegaConfigLoader`](advanced_configuration.md#how-to-do-templating-with-the-omegaconfigloader). Where in `TemplatedConfigLoader` it was necessary to provide the template values in a `globals` file or dictionary, in `OmegaConfigLoader` you can provide these values within the same file that has the placeholders or a file that has a name that follows [the same config pattern specified](configuration_basics.md#configuration-patterns). Suppose you are migrating a templated **catalog** file from using `TemplatedConfigLoader` to `OmegaConfigLoader` you would do the following: @@ -126,7 +126,7 @@ Suppose you are migrating a templated **catalog** file from using `TemplatedConf ```diff - bucket_name: "my_s3_bucket" -+ _bucket_name: "my_s3_bucket" ++ _bucket_name: "my_s3_bucket" # kedro requires `_` to mark templatable keys - key_prefix: "my/key/prefix/" + _key_prefix: "my/key/prefix/" @@ -153,7 +153,7 @@ raw_car_data: + filepath: "s3://${_bucket_name}/data/${_key_prefix}/raw/cars.csv" ``` -#### Providing default values for templates with `oc.select` +#### Providing default values for templates via `oc.select` To provide a default for any template values you have to use [the omegaconf `oc.select` resolver](https://omegaconf.readthedocs.io/en/latest/custom_resolvers.html#oc-select). ```diff @@ -196,7 +196,7 @@ The globals templating in your catalog configuration will need to be updated to ```diff raw_boat_data: -- type: "${datasets.spark}" # nested paths into global dict are allowed +- type: "${datasets.spark}" + type: "${globals:datasets.spark}" # nested paths into global dict are allowed - filepath: "s3a://${bucket_name}/${key_prefix}/${folders.raw}/boats.csv" + filepath: "s3a://${globals:bucket_name}/${globals:key_prefix}/${globals:folders.raw}/boats.csv" From d04e444236cf266e9d2321064368186daa90c134 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Fri, 18 Aug 2023 17:31:00 +0200 Subject: [PATCH 11/17] update how to do default globals for ocl Signed-off-by: Merel Theisen --- docs/source/configuration/config_loader_migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index e9d9aa00b4..1944d3bb10 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -206,7 +206,7 @@ raw_car_data: - type: "${datasets.csv}" + type: "${globals:datasets.csv}" - filepath: "s3://${bucket_name}/data/${key_prefix}/${folders.raw}/${filename|cars.csv}" # default to 'cars.csv' if the 'filename' key is not found in the global dict -+ filepath: "s3://${globals:bucket_name}/data/${globals:key_prefix}/${globals:folders.raw}/${globals:${oc.select:filename|cars.csv}}" # default to 'cars.csv' if the 'filename' key is not found in the global dict ++ filepath: "s3://${globals:bucket_name}/data/${globals:key_prefix}/${globals:folders.raw}/${globals:filename,'cars.csv'}" # default to 'cars.csv' if the 'filename' key is not found in the global dict ``` ### 8. Jinja2 From 1f15fefdf4609a54ab0656faf7666f7d369c7a0e Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Fri, 18 Aug 2023 16:32:01 +0100 Subject: [PATCH 12/17] Apply suggestions from code review Co-authored-by: Joel <35801847+datajoely@users.noreply.github.com> --- docs/source/configuration/config_loader_migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 1944d3bb10..9410ab8bf6 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -209,7 +209,7 @@ raw_car_data: + filepath: "s3://${globals:bucket_name}/data/${globals:key_prefix}/${globals:folders.raw}/${globals:filename,'cars.csv'}" # default to 'cars.csv' if the 'filename' key is not found in the global dict ``` -### 8. Jinja2 +### 8. Deprecation of Jinja2 `OmegaConfigLoader` does not support Jinja2 syntax in configuration. However, users can achieve similar functionality with the `OmegaConfigLoader` in combination with [dataset factories](../data/data_catalog.md#load-multiple-datasets-with-similar-configuration-using-dataset-factories). If you take the example from [the `TemplatedConfigLoader` with Jinja2 documentation](advanced_configuration.md#how-to-use-jinja2-syntax-in-configuration) you can rewrite your configuration as follows to work with `OmegaConfigLoader`: From 0b49d4c8ddcba9d504c226a528eeb4f278377d11 Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:43:34 +0100 Subject: [PATCH 13/17] Apply suggestions from code review --- docs/source/configuration/config_loader_migration.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 9410ab8bf6..1d803f13d0 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -63,7 +63,7 @@ For error and exception handling, most errors are the same. Those you need to be ## [`TemplatedConfigLoader`](/kedro.config.TemplatedConfigLoader) to [`OmegaConfigLoader`](/kedro.config.OmegaConfigLoader) -### 1. Install the Required Library +### 1. Install the required library The [`OmegaConfigLoader`](advanced_configuration.md#omegaconfigloader) was introduced in Kedro `0.18.5` and is based on [OmegaConf](https://omegaconf.readthedocs.io/). Features that replace `TemplatedConfigLoader` functionality have been released in later versions, so we recommend users to install at least Kedro version `0.18.X` to properly replace the `TemplatedConfigLoader` with `OmegaConfigLoader`. You can install both this Kedro version and `omegaconf` using `pip`: @@ -88,7 +88,7 @@ To use `OmegaConfigLoader` in your project, set the `CONFIG_LOADER_CLASS` consta + CONFIG_LOADER_CLASS = OmegaConfigLoader ``` -### 3. Import Statements +### 3. Import statements Replace the import statement for `TemplatedConfigLoader` with the one for `OmegaConfigLoader`: ```diff @@ -97,10 +97,10 @@ Replace the import statement for `TemplatedConfigLoader` with the one for `Omega + from kedro.config import OmegaConfigLoader ``` -### 4. File Format Support +### 4. File format support `OmegaConfigLoader` supports only `yaml` and `json` file formats. Make sure that all your configuration files are in one of these formats. If you were using other formats with `TemplatedConfigLoader`, convert them to `yaml` or `json`. -### 5. Load Configuration +### 5. Load configuration The method to load the configuration using `OmegaConfigLoader` differs slightly from that used by `TemplatedConfigLoader`, which allowed users to access configuration through the `.get()` method and required patterns as argument. When you migrate to use `OmegaConfigLoader` it requires you to fetch configuration through a configuration key that points to [configuration patterns specified in the loader class](configuration_basics.md#configuration-patterns) or [provided in the `CONFIG_LOADER_ARGS`](advanced_configuration.md#how-to-change-which-configuration-files-are-loaded) in `settings.py`. @@ -116,7 +116,7 @@ When you migrate to use `OmegaConfigLoader` it requires you to fetch configurat In this example, the `"catalog"` key points to the default catalog patterns specified in the `OmegaConfigLoader` class. -### 6. Templating of Values +### 6. Templating of values Templating of values is done through native [variable interpolation in `OmegaConfigLoader`](advanced_configuration.md#how-to-do-templating-with-the-omegaconfigloader). Where in `TemplatedConfigLoader` it was necessary to provide the template values in a `globals` file or dictionary, in `OmegaConfigLoader` you can provide these values within the same file that has the placeholders or a file that has a name that follows [the same config pattern specified](configuration_basics.md#configuration-patterns). @@ -231,6 +231,6 @@ If you take the example from [the `TemplatedConfigLoader` with Jinja2 documentat - {% endfor %} ``` -### 9. Exception Handling +### 9. Exception handling For error and exception handling, most errors are the same. Those you need to be aware of that are different between the original `TemplatedConfigLoader` and `OmegaConfigLoader` are as follows: * For missing template values `OmegaConfigLoader` throws `omegaconf.errors.InterpolationKeyError`. From 6baa5502d167ed1c8e0c1509806172c305e723f4 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Tue, 29 Aug 2023 11:51:59 +0200 Subject: [PATCH 14/17] Add link to globals docs for ocl Signed-off-by: Merel Theisen --- docs/source/configuration/config_loader_migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 1d803f13d0..7a469b057c 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -165,7 +165,7 @@ boats: ``` ### 7. Globals -If you want to share variables across configuration types, e.g. parameters and catalog, and environments you need to use [the custom globals resolver with the `OmegaConfigLoader`](...). +If you want to share variables across configuration types, e.g. parameters and catalog, and environments you need to use [the custom globals resolver with the `OmegaConfigLoader`](advanced_configuration.md#how-to-use-global-variables-with-the-omegaconfigloader). The `OmegaConfigLoader` requires global values to be provided in a `globals.yml` file. The following section explains the differences between using globals with `TemplatedConfigLoader` and the `OmegaConfigLoader`. Let's assume your project contains a `conf/base/globals.yml` file with the following contents: From 40df8ff1f42ac5165d8a815605a32fc0eabda80a Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Tue, 29 Aug 2023 14:36:17 +0200 Subject: [PATCH 15/17] Fix link + address review comments Signed-off-by: Merel Theisen --- docs/source/configuration/config_loader_migration.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 7a469b057c..30236475f6 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -119,9 +119,10 @@ In this example, the `"catalog"` key points to the default catalog patterns spec ### 6. Templating of values Templating of values is done through native [variable interpolation in `OmegaConfigLoader`](advanced_configuration.md#how-to-do-templating-with-the-omegaconfigloader). Where in `TemplatedConfigLoader` it was necessary to provide the template values in a `globals` file or dictionary, in `OmegaConfigLoader` you can provide these values within the same file that has the placeholders or a file that has a name that follows [the same config pattern specified](configuration_basics.md#configuration-patterns). +The variable interpolation is scoped to a specific configuration type and environment. If you want to share templated values across configuration types and environments, [you will need to use globals](#7-globals). Suppose you are migrating a templated **catalog** file from using `TemplatedConfigLoader` to `OmegaConfigLoader` you would do the following: -1. Rename `conf/base/globals.yml` to match the patterns specified for catalog (`["catalog*", "catalog*/**", "**/catalog*"]`), e.g. `conf/base/catalog_globals.yml` +1. Rename `conf/base/globals.yml` to match the patterns specified for catalog (`["catalog*", "catalog*/**", "**/catalog*"]`), for example `conf/base/catalog_globals.yml` 2. Add an underscore `_` to any catalog template values. This is needed because of how catalog entries are validated. ```diff @@ -165,8 +166,8 @@ boats: ``` ### 7. Globals -If you want to share variables across configuration types, e.g. parameters and catalog, and environments you need to use [the custom globals resolver with the `OmegaConfigLoader`](advanced_configuration.md#how-to-use-global-variables-with-the-omegaconfigloader). -The `OmegaConfigLoader` requires global values to be provided in a `globals.yml` file. The following section explains the differences between using globals with `TemplatedConfigLoader` and the `OmegaConfigLoader`. +If you want to share variables across configuration types, for example parameters and catalog, and environments you need to use [the custom globals resolver with the `OmegaConfigLoader`](advanced_configuration.md#how-to-use-global-variables-with-the-omegaconfigloader). +The `OmegaConfigLoader` requires global values to be provided in a `globals.yml` file. Note that using a `globals_dict` to provide globals is not supported with `OmegaConfigLoader`. The following section explains the differences between using globals with `TemplatedConfigLoader` and the `OmegaConfigLoader`. Let's assume your project contains a `conf/base/globals.yml` file with the following contents: @@ -210,7 +211,7 @@ raw_car_data: ``` ### 8. Deprecation of Jinja2 -`OmegaConfigLoader` does not support Jinja2 syntax in configuration. However, users can achieve similar functionality with the `OmegaConfigLoader` in combination with [dataset factories](../data/data_catalog.md#load-multiple-datasets-with-similar-configuration-using-dataset-factories). +`OmegaConfigLoader` does not support Jinja2 syntax in configuration. However, users can achieve similar functionality with the `OmegaConfigLoader` in combination with [dataset factories](../data/kedro_dataset_factories.md). If you take the example from [the `TemplatedConfigLoader` with Jinja2 documentation](advanced_configuration.md#how-to-use-jinja2-syntax-in-configuration) you can rewrite your configuration as follows to work with `OmegaConfigLoader`: ```diff From 17b594e2fd4554ece4992b38b9685fc3634f2c9f Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Tue, 29 Aug 2023 14:37:11 +0200 Subject: [PATCH 16/17] Set correct 0.18.x version Signed-off-by: Merel Theisen --- docs/source/configuration/config_loader_migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 30236475f6..4ced6b6723 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -65,11 +65,11 @@ For error and exception handling, most errors are the same. Those you need to be ### 1. Install the required library The [`OmegaConfigLoader`](advanced_configuration.md#omegaconfigloader) was introduced in Kedro `0.18.5` and is based on [OmegaConf](https://omegaconf.readthedocs.io/). Features that replace `TemplatedConfigLoader` functionality have been released in later versions, so we recommend users -to install at least Kedro version `0.18.X` to properly replace the `TemplatedConfigLoader` with `OmegaConfigLoader`. +to install at least Kedro version `0.18.13` to properly replace the `TemplatedConfigLoader` with `OmegaConfigLoader`. You can install both this Kedro version and `omegaconf` using `pip`: ```bash -pip install kedro==0.18.X +pip install kedro>=0.18.13, <0.19.0 ``` This would be the minimum required Kedro version which includes `omegaconf` as a dependency and the necessary functionality to replace `TemplatedConfigLoader`. Or you can run: From 367539e3a368194fbb072e704d91d260c973d9ca Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:16:22 +0100 Subject: [PATCH 17/17] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Juan Luis Cano Rodríguez --- docs/source/configuration/config_loader_migration.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/configuration/config_loader_migration.md b/docs/source/configuration/config_loader_migration.md index 4ced6b6723..21c25f9093 100644 --- a/docs/source/configuration/config_loader_migration.md +++ b/docs/source/configuration/config_loader_migration.md @@ -69,7 +69,7 @@ to install at least Kedro version `0.18.13` to properly replace the `TemplatedCo You can install both this Kedro version and `omegaconf` using `pip`: ```bash -pip install kedro>=0.18.13, <0.19.0 +pip install "kedro>=0.18.13, <0.19.0" ``` This would be the minimum required Kedro version which includes `omegaconf` as a dependency and the necessary functionality to replace `TemplatedConfigLoader`. Or you can run: @@ -93,7 +93,6 @@ Replace the import statement for `TemplatedConfigLoader` with the one for `Omega ```diff - from kedro.config import TemplatedConfigLoader - + from kedro.config import OmegaConfigLoader ```