From 0ac154daa3f7a3c0f97d661ac04b65bc6e3f3bee Mon Sep 17 00:00:00 2001 From: Elena Khaustova Date: Fri, 13 Sep 2024 12:19:59 +0100 Subject: [PATCH] Merged with protocol Signed-off-by: Elena Khaustova --- kedro/framework/hooks/specs.py | 12 ++++++------ kedro/framework/project/__init__.py | 9 --------- kedro/io/__init__.py | 3 +-- kedro/io/kedro_data_catalog.py | 6 +----- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/kedro/framework/hooks/specs.py b/kedro/framework/hooks/specs.py index c80e9625ec..996134920e 100644 --- a/kedro/framework/hooks/specs.py +++ b/kedro/framework/hooks/specs.py @@ -63,7 +63,7 @@ def before_node_run( Args: node: The ``Node`` to run. - catalog: A ``BaseDataCatalog`` containing the node's inputs and outputs. + catalog: A catalog containing the node's inputs and outputs. inputs: The dictionary of inputs dataset. The keys are dataset names and the values are the actual loaded input data, not the dataset instance. @@ -93,7 +93,7 @@ def after_node_run( # noqa: PLR0913 Args: node: The ``Node`` that ran. - catalog: A ``BaseDataCatalog`` containing the node's inputs and outputs. + catalog: A catalog containing the node's inputs and outputs. inputs: The dictionary of inputs dataset. The keys are dataset names and the values are the actual loaded input data, not the dataset instance. @@ -122,7 +122,7 @@ def on_node_error( # noqa: PLR0913 Args: error: The uncaught exception thrown during the node run. node: The ``Node`` to run. - catalog: A ``BaseDataCatalog`` containing the node's inputs and outputs. + catalog: A catalog containing the node's inputs and outputs. inputs: The dictionary of inputs dataset. The keys are dataset names and the values are the actual loaded input data, not the dataset instance. @@ -164,7 +164,7 @@ def before_pipeline_run( } pipeline: The ``Pipeline`` that will be run. - catalog: The ``BaseDataCatalog`` to be used during the run. + catalog: The catalog to be used during the run. """ pass @@ -202,7 +202,7 @@ def after_pipeline_run( run_result: The output of ``Pipeline`` run. pipeline: The ``Pipeline`` that was run. - catalog: The ``BaseDataCatalog`` used during the run. + catalog: The catalog used during the run. """ pass @@ -242,7 +242,7 @@ def on_pipeline_error( } pipeline: The ``Pipeline`` that will was run. - catalog: The ``BaseDataCatalog`` used during the run. + catalog: The catalog used during the run. """ pass diff --git a/kedro/framework/project/__init__.py b/kedro/framework/project/__init__.py index 094cfd4aef..195fa077f6 100644 --- a/kedro/framework/project/__init__.py +++ b/kedro/framework/project/__init__.py @@ -52,15 +52,6 @@ def validate( default_class = self.default(settings, self) for name in self.names: setting_value = getattr(settings, name) - # Allow using new KedroDataCatalog - # TODO: remove with the old catalog - if ( - f"{setting_value.__module__}.{setting_value.__qualname__}" - == "kedro.io.kedro_data_catalog.KedroDataCatalog" - and f"{default_class.__module__}.{default_class.__qualname__}" - == "kedro.io.data_catalog.DataCatalog" - ): - continue if not issubclass(setting_value, default_class): raise ValidationError( f"Invalid value '{setting_value.__module__}.{setting_value.__qualname__}' " diff --git a/kedro/io/__init__.py b/kedro/io/__init__.py index 17abb93e9e..9697e1bd35 100644 --- a/kedro/io/__init__.py +++ b/kedro/io/__init__.py @@ -16,14 +16,13 @@ Version, ) from .data_catalog import DataCatalog -from .kedro_data_catalog import BaseDataCatalog, KedroDataCatalog +from .kedro_data_catalog import KedroDataCatalog from .lambda_dataset import LambdaDataset from .memory_dataset import MemoryDataset from .shared_memory_dataset import SharedMemoryDataset __all__ = [ "AbstractDataset", - "BaseDataCatalog", "AbstractVersionedDataset", "CachedDataset", "CatalogProtocol", diff --git a/kedro/io/kedro_data_catalog.py b/kedro/io/kedro_data_catalog.py index cba1b8a28f..c63d557d66 100644 --- a/kedro/io/kedro_data_catalog.py +++ b/kedro/io/kedro_data_catalog.py @@ -11,9 +11,8 @@ import difflib import logging import re -from typing import Any, Union +from typing import Any -from kedro.io import DataCatalog from kedro.io.catalog_config_resolver import CatalogConfigResolver, Patterns from kedro.io.core import ( AbstractDataset, @@ -333,6 +332,3 @@ def exists(self, name: str) -> bool: except DatasetNotFoundError: return False return dataset.exists() - - -BaseDataCatalog = Union[DataCatalog, KedroDataCatalog]