Skip to content

Commit

Permalink
Merged with protocol
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Khaustova <ymax70rus@gmail.com>
  • Loading branch information
ElenaKhaustova committed Sep 13, 2024
1 parent 9540a32 commit 0ac154d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
12 changes: 6 additions & 6 deletions kedro/framework/hooks/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
9 changes: 0 additions & 9 deletions kedro/framework/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__}' "
Expand Down
3 changes: 1 addition & 2 deletions kedro/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 1 addition & 5 deletions kedro/io/kedro_data_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -333,6 +332,3 @@ def exists(self, name: str) -> bool:
except DatasetNotFoundError:
return False
return dataset.exists()


BaseDataCatalog = Union[DataCatalog, KedroDataCatalog]

0 comments on commit 0ac154d

Please sign in to comment.