Created
April 30, 2019 22:12
-
-
Save cicdw/7610fcd0d6705e37eb7ace2330335283 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
from prefect import task, Flow | |
@task | |
def create_list(): | |
return [1, 1, 2, 3] | |
@task | |
def add_one(x): | |
return x + 1 | |
@task | |
def get_sum(x): | |
return sum(x) | |
with Flow("simple-map") as f: | |
plus_one = add_one.map(create_list) | |
plus_two = add_one.map(plus_one) | |
result = get_sum(plus_two) | |
f.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment