Hello all!
Quick question, is it possible to run tasks inside a task?
So for example:
Copy code
@task
my_inner_task():
# do something
@task
def my_task_one():
my_inner_task()
c
Chris White
10/20/2020, 3:34 PM
Hi Manuel - if you want to reuse task logic within another task you should instead call the
run
method directly:
Copy code
@task
my_inner_task():
# do something
@task
def my_task_one():
my_inner_task.run()
Note that when you do this, you are not asking Prefect to track the dependency or any stateful behavior of the inner task - instead you are simply reusing common python logic (which is perfectly valid)
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.