-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose subworkflow inputs, outputs in node execution (#503)
* expose subworkflow inputs, outputs in node execution Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> * add docstring Signed-off-by: cosmicBboy <[email protected]> * add docstring to list_node_executions, update sync logic Signed-off-by: cosmicBboy <[email protected]> * add comment to subworkflow get_interface @wild-endeavor Signed-off-by: cosmicBboy <[email protected]> * update executions property Signed-off-by: cosmicBboy <[email protected]> * cache interface for node execution, redefine as property Signed-off-by: cosmicBboy <[email protected]> * fix lint Signed-off-by: cosmicBboy <[email protected]> Signed-off-by: wild-endeavor <[email protected]>
- Loading branch information
1 parent
25f21d5
commit ce744f0
Showing
9 changed files
with
140 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/flytekit/integration/control_plane/mock_flyte_repo/workflows/basic/subworkflows.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import typing | ||
|
||
from flytekit import task, workflow | ||
|
||
|
||
@task | ||
def t1(a: int) -> typing.NamedTuple("OutputsBC", t1_int_output=int, c=str): | ||
return a + 2, "world" | ||
|
||
|
||
@workflow | ||
def my_subwf(a: int = 42) -> (str, str): | ||
x, y = t1(a=a) | ||
u, v = t1(a=x) | ||
return y, v | ||
|
||
|
||
@workflow | ||
def parent_wf(a: int) -> (int, str, str): | ||
x, y = t1(a=a) | ||
u, v = my_subwf(a=x) | ||
return x, u, v | ||
|
||
|
||
if __name__ == "__main__": | ||
print(f"Running my_wf(a=3) {parent_wf(a=3)}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters