Skip to content

Commit

Permalink
Replace type checking with CatalogProtocol
Browse files Browse the repository at this point in the history
Signed-off-by: Ankita Katiyar <[email protected]>
  • Loading branch information
ankatiyar committed Sep 23, 2024
1 parent 552b973 commit 7cf254e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kedro-airflow/kedro_airflow/grouping.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from kedro.io import DataCatalog
from kedro.io import CatalogProtocol
from kedro.pipeline.node import Node
from kedro.pipeline.pipeline import Pipeline

Expand All @@ -11,7 +11,7 @@ def _is_memory_dataset(catalog, dataset_name: str) -> bool:
return False


def get_memory_datasets(catalog: DataCatalog, pipeline: Pipeline) -> set[str]:
def get_memory_datasets(catalog: CatalogProtocol, pipeline: Pipeline) -> set[str]:
"""Gather all datasets in the pipeline that are of type MemoryDataset, excluding 'parameters'."""
return {
dataset_name
Expand All @@ -21,7 +21,7 @@ def get_memory_datasets(catalog: DataCatalog, pipeline: Pipeline) -> set[str]:


def create_adjacency_list(
catalog: DataCatalog, pipeline: Pipeline
catalog: CatalogProtocol, pipeline: Pipeline
) -> tuple[dict[str, set], dict[str, set]]:
"""
Builds adjacency list (adj_list) to search connected components - undirected graph,
Expand All @@ -48,7 +48,7 @@ def create_adjacency_list(


def group_memory_nodes(
catalog: DataCatalog, pipeline: Pipeline
catalog: CatalogProtocol, pipeline: Pipeline
) -> tuple[dict[str, list[Node]], dict[str, list[str]]]:
"""
Nodes that are connected through MemoryDatasets cannot be distributed across
Expand Down

0 comments on commit 7cf254e

Please sign in to comment.