Skip to content

Instantly share code, notes, and snippets.

@kvnkho
Last active May 6, 2022 13:51
Show Gist options
  • Select an option

  • Save kvnkho/a9a4e64450eb49af5dacd98273a16ad6 to your computer and use it in GitHub Desktop.

Select an option

Save kvnkho/a9a4e64450eb49af5dacd98273a16ad6 to your computer and use it in GitHub Desktop.
from prefect import flow, task
import time
@task
def add_one(x):
time.sleep(2)
return x+1
@task
def times_two(x):
return x*2
@flow
def main():
for i in range(5):
a = add_one(i).result()
if a > 1:
b = times_two(a)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment