Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wild-endeavor/a3bb173377cf36b94fe92e78541bfe23 to your computer and use it in GitHub Desktop.
Save wild-endeavor/a3bb173377cf36b94fe92e78541bfe23 to your computer and use it in GitHub Desktop.
bool
from flytekit import task, workflow
@task
def say_hello(bb: bool) -> str:
if bb:
return "hello bb"
return "hello world"
@workflow
def my_wf(remote: bool) -> str:
res = say_hello(bb=remote)
return res
if __name__ == "__main__":
print(f"Running my_wf() {my_wf(remote=True)}")
print(f"Running my_wf() {my_wf(remote=False)}")
@wild-endeavor
Copy link
Author

(cookbook) ytong@argus:~/go/src/github.com/flyteorg/flytesnacks/cookbook [flyte-sandbox] (master) $ python core/flyte_basics/use_bool.py
Running my_wf() hello bb
(cookbook) ytong@argus:~/go/src/github.com/flyteorg/flytesnacks/cookbook [flyte-sandbox] (master) $ python core/flyte_basics/use_bool.py
Running my_wf() hello bb
Running my_wf() hello world
(cookbook) ytong@argus:~/go/src/github.com/flyteorg/flytesnacks/cookbook [flyte-sandbox] (master) $ pyflyte run core/flyte_basics/use_bool.py my_wf --remote
hello bb
(cookbook) ytong@argus:~/go/src/github.com/flyteorg/flytesnacks/cookbook [flyte-sandbox] (master) $ pyflyte run core/flyte_basics/use_bool.py my_wf
hello world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment