Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX(kedro-airflow): grouping with fork #536

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions kedro-airflow/kedro_airflow/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def group_memory_nodes(catalog: DataCatalog, pipeline: Pipeline):
together. Essentially, this computes connected components over the graph of
nodes connected by MemoryDatasets.
"""

# get all memory datasets in the pipeline
memory_datasets = get_memory_datasets(catalog, pipeline)

Expand All @@ -58,8 +59,12 @@ def group_memory_nodes(catalog: DataCatalog, pipeline: Pipeline):
sequence_id = None
for i in node.inputs:
if i in memory_datasets:
assert sequence_id is None or sequence_id == sequence_map[i]
sequence_id = sequence_map[i]
if sequence_id is None:
sequence_id = sequence_map[i]
else:
# merge sequences
node_sequences[sequence_id].extend(node_sequences[sequence_map[i]])
node_sequences[sequence_map[i]] = None

# Append to map
node_sequences[sequence_id].append(node)
Expand All @@ -73,6 +78,7 @@ def group_memory_nodes(catalog: DataCatalog, pipeline: Pipeline):
nodes = {
node_sequence_name(node_sequence): node_sequence
for node_sequence in node_sequences
if node_sequence is not None
}

# Inverted mapping
Expand Down
Loading