bruno.corucho07/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 """
from 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.corucho07/20/2020, 3:06 PM
Laura Lorenz (she/her)07/20/2020, 3:08 PM
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
as a whole that can be operated on as a Prefect task
bruno.corucho07/21/2020, 2:19 PM