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 modular pipelines breaking when collapsed. #1651

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions package/kedro_viz/models/flowchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,18 +407,14 @@ def inputs(self) -> Set[str]:
Intuitively, the set of inputs for this modular pipeline is the set of all
external and internal inputs, excluding the ones also serving as outputs.
"""
return (self.external_inputs | self.internal_inputs) - (
self.external_outputs | self.internal_outputs
)
return (self.external_inputs | self.internal_inputs) - self.internal_outputs

@property
def outputs(self) -> Set[str]:
"""Return a set of inputs for this modular pipeline.
Follow the same logic as the inputs calculation.
"""
return (self.external_outputs | self.internal_outputs) - (
self.external_inputs | self.internal_inputs
)
return self.external_outputs | (self.internal_outputs - self.internal_inputs)


class TaskNodeMetadata(GraphNodeMetadata):
Expand Down
5 changes: 3 additions & 2 deletions package/tests/test_api/test_rest/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def assert_example_data(response_data):
{"source": "uk.data_science", "target": "d5a8b994"},
{"source": "0ecea0de", "target": "uk.data_science"},
{"source": "uk", "target": "d5a8b994"},
{"source": "uk", "target": "0ecea0de"},
]
assert_dict_list_equal(
response_data.pop("edges"), expected_edges, sort_keys=("source", "target")
Expand Down Expand Up @@ -234,9 +235,9 @@ def assert_example_data(response_data):
{"id": "uk.data_processing", "type": "modularPipeline"},
],
"id": "uk",
"inputs": ["f0ebef01", "13399a82", "f1f1425b"],
"inputs": ["f0ebef01", "13399a82", "f1f1425b", "0ecea0de"],
"name": "uk",
"outputs": ["d5a8b994"],
"outputs": ["d5a8b994", "0ecea0de"],
},
"uk.data_processing": {
"children": [
Expand Down