Last active
June 18, 2020 16:13
-
-
Save lauralorenz/31dcbf10d32193278e7707332e7717d1 to your computer and use it in GitHub Desktop.
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
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