tasks.ref(...)

Function used to retrieve the output of other tasks.

tasks.ref(module: str)

  • Parameters

    • module: the module whose task's output you wish to retrieve. This string should be the path of the module relative to the modules directory.

Example:

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!"
        previous_task_output = tasks.ref("first_task")
        return test_str + previous_task_output

Last updated