Skip to content

Commit 812ad27

Browse files
Look at phases and wait is stateful (#623)
* Look at phases and wait is stateful Signed-off-by: Ketan Umare <[email protected]> * Update content/user-guide/task-programming/remote-tasks.md --------- Signed-off-by: Ketan Umare <[email protected]> Co-authored-by: Ketan Umare <[email protected]> Co-authored-by: Yee Hing Tong <[email protected]>
1 parent 1733da7 commit 812ad27

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

content/user-guide/task-programming/remote-tasks.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ flyte run orchestration_env.py orchestrate_pipeline --data_path s3://my-bucket/d
197197
You can also run any remote task directly using a script in a similar way
198198
```python
199199
import flyte
200+
import flyte.models
200201
import flyte.remote
201202

202203
flyte.init_from_config()
@@ -214,7 +215,12 @@ print(f"Current Phase: {run.phase}")
214215
# You can wait for the execution
215216
run.wait()
216217

217-
# Wait today does not automatically update the phase of the `run` object itself. We will soon add a sync method
218+
# Only available after flyte >= 2.0.0b39
219+
print(f"Current phase: {run.phase}")
220+
221+
# Phases can be compared to
222+
if run.phase == flyte.models.ActionPhase.SUCCEEDED:
223+
print(f"Run completed!")
218224

219225
# You can then retrieve the outputs
220226
print(f"Pipeline result: {run.outputs()}")

0 commit comments

Comments
 (0)