Skip to content

Instantly share code, notes, and snippets.

@lauralorenz
Last active June 18, 2020 16:13
Show Gist options
  • Save lauralorenz/31dcbf10d32193278e7707332e7717d1 to your computer and use it in GitHub Desktop.
Save lauralorenz/31dcbf10d32193278e7707332e7717d1 to your computer and use it in GitHub Desktop.
import time
from prefect import task, Flow
from prefect.engine.executors import DaskExecutor
@task
def times():
return [1, 5, 10]
@task
def sleep(x):
print(f'sleeping for {x}')
time.sleep(x)
print(f'done sleeping for {x}')
return x
with Flow("mapping-test") as flow:
sleep.map(sleep.map(times))
flow.run(executor=DaskExecutor())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment