tasks.ref(...)
Function used to retrieve the output of other tasks.
import prism.task
import prism.target
import prism.decorators
class ExampleTask(prism.task.PrismTask):
@prism.decorators.target(
type=prism.target.Txt,
loc="/Users/hello_world.txt",
**kwargs
)
def run(self, tasks, hooks):
test_str = "Hello, world!"
# Get output from task in first_task.py. If this module
# contains multiple tasks, then we'll need to specify
# the task via <module_name>.<task_name>
previous_task_output = tasks.ref("first_task")
return test_str + previous_task_outputfrom prism.decorators import task
@task()
def example_function(tasks, hooks):
test_str = "Hello, world!"
# Get output from task in first_task.py. If this module
# contains multiple tasks, then we'll need to specify
# the task via <module_name>.<task_name>
previous_task_output = tasks.ref("first_task")
return test_str + previous_task_output