From 5bdf16b4254be1e4db277d8955de98f7bc52f6dc Mon Sep 17 00:00:00 2001 From: Elena Khaustova Date: Mon, 7 Oct 2024 18:49:08 +0100 Subject: [PATCH] Added usage example and updated docstrings with experimental feature note Signed-off-by: Elena Khaustova --- RELEASE.md | 6 ++++-- kedro/io/kedro_data_catalog.py | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index c9a871b0e0..e80e7f112d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -12,12 +12,14 @@ * Moved pattern resolution logic from `DataCatalog` to a separate component - `CatalogConfigResolver`. Updated `DataCatalog` to use `CatalogConfigResolver` internally. * Made packaged Kedro projects return `session.run()` output to be used when running it in the interactive environment. * Enhanced `OmegaConfigLoader` configuration validation to detect duplicate keys at all parameter levels, ensuring comprehensive nested key checking. + +**Note:** ``KedroDataCatalog`` is an experimental feature, so please mind possible breaking changes while using it. + ## Bug fixes and other changes * Fixed bug where using dataset factories breaks with `ThreadRunner`. * Fixed a bug where `SharedMemoryDataset.exists` would not call the underlying `MemoryDataset`. * Fixed template projects example tests. -* Made credentials loading consistent between `KedroContext._get_catalog()` and `resolve_patterns` so that both us -e `_get_config_credentials()` +* Made credentials loading consistent between `KedroContext._get_catalog()` and `resolve_patterns` so that both use `_get_config_credentials()` ## Breaking changes to the API * Removed `ShelveStore` to address a security vulnerability. diff --git a/kedro/io/kedro_data_catalog.py b/kedro/io/kedro_data_catalog.py index 882eb19cf8..f9cb40ae4c 100644 --- a/kedro/io/kedro_data_catalog.py +++ b/kedro/io/kedro_data_catalog.py @@ -3,6 +3,9 @@ use a ``KedroDataCatalog``, you need to instantiate it with a dictionary of datasets. Then it will act as a single point of reference for your calls, relaying load and save functions to the underlying datasets. + +``KedroDataCatalog`` is an experimental feature aimed to replace ``DataCatalog`` in the future. +Expect possible breaking changes while using it. """ from __future__ import annotations @@ -44,6 +47,9 @@ def __init__( single point of reference for your calls, relaying load and save functions to the underlying datasets. + Note: ``KedroDataCatalog`` is an experimental feature, so please mind + possible breaking changes while using it. + Args: datasets: A dictionary of dataset names and dataset instances. raw_data: A dictionary with data to be added in memory as `MemoryDataset`` instances. @@ -56,6 +62,13 @@ def __init__( case-insensitive string that conforms with operating system filename limitations, b) always return the latest version when sorted in lexicographical order. + + Example: + :: + >>> # settings.py + >>> from kedro.io import KedroDataCatalog + >>> + >>> DATA_CATALOG_CLASS = KedroDataCatalog """ self._config_resolver = config_resolver or CatalogConfigResolver() self._datasets = datasets or {}