bruno.corucho
07/20/2020, 2:56 PM@task
def i_am_too_big():
"""
multiple
lines of code
that should
go into
a different method
"""
"""
some
sequential (to be parallelized)
http
calls
""""
"""
multiple
lines of code
that should
go into
a different method
"""
nicholas
07/20/2020, 3:02 PMfrom prefect import Task
def MyLargeTask(Task):
def small_method_1(self):
# do something
def small_method_2(self):
# do something
def run(self):
# do something
bruno.corucho
07/20/2020, 3:06 PMLaura Lorenz (she/her)
07/20/2020, 3:08 PMbruno.corucho
07/20/2020, 3:08 PMnicholas
07/21/2020, 2:14 PM.map
because that's a task-level operator; you're attempting to use it on results returned from normal python methods. Each of those functions you've defined in your subclass is a regular python function and so should be treated as such, it's the PeanutsTask
as a whole that can be operated on as a Prefect taskbruno.corucho
07/21/2020, 2:19 PMnicholas
07/21/2020, 2:21 PM