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

[IO-1496][external] Ensure edges are returned as WFEdgeCore objects #695

Merged
merged 19 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
9 changes: 3 additions & 6 deletions darwin/future/meta/objects/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from uuid import UUID

from darwin.future.core.items import get_item_ids_stage, move_items_to_stage
from darwin.future.data_objects.workflow import WFStageCore
from darwin.future.data_objects.workflow import WFEdgeCore, WFStageCore
from darwin.future.meta.objects.base import MetaBase


Expand Down Expand Up @@ -64,9 +64,6 @@ def type(self) -> str:
return self._element.type.value

@property
def edges(self) -> List[List[UUID]]:
def edges(self) -> List[WFEdgeCore]:
"""Edge ID, source stage ID, target stage ID."""
return [
[edge.id, edge.source_stage_id, edge.target_stage_id]
for edge in self._element.edges
]
return list(self._element.edges)
10 changes: 8 additions & 2 deletions darwin/future/tests/meta/objects/test_stagemeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,14 @@ def test_get_stage_edges(stage_meta):
},
)
assert len(test_stage.edges) == 2
assert len(test_stage.edges[0]) == 3
assert test_stage.edges[0][0] == UUID("00000000-0000-0000-0000-000000000000")
assert test_stage.edges[0].name == "edge_1"
assert test_stage.edges[0].id == UUID("00000000-0000-0000-0000-000000000000")
assert test_stage.edges[0].source_stage_id == UUID(
"00000000-0000-0000-0000-000000000000"
)
assert test_stage.edges[0].target_stage_id == UUID(
"00000000-0000-0000-0000-000000000000"
)


def test_stage_str_method(stage_meta: Stage) -> None:
Expand Down
Loading