Skip to content

Instantly share code, notes, and snippets.

@cicdw
Created April 30, 2019 22:12
Show Gist options
  • Save cicdw/7610fcd0d6705e37eb7ace2330335283 to your computer and use it in GitHub Desktop.
Save cicdw/7610fcd0d6705e37eb7ace2330335283 to your computer and use it in GitHub Desktop.
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