a

    as

    2 years ago
    Hey, I have a question on the use of the
    target
    parameter of tasks for checkpointing. If I'm correct it will not run the task if it can find a file with the name specified with the
    target
    parameter. correct? I'm wondering what happens if an upstream task has been triggered. Does it still looks for the target file or does task run nonetheless because the input has changed? If not, is there a way to achieve this behavior? Thanks
    Jenny

    Jenny

    2 years ago
    Hello @as Thanks for the question. I'm not sure of the answer to this off the top of my head but I'll check with the wider team and get back to you.
    Jim Crist-Harif

    Jim Crist-Harif

    2 years ago
    If a target is specified, it will always look for the target file (and not run if found), regardless of input parameters. Note that the path of the target can be templated based on parameters in
    prefect.context
    , so if you want a different path for different cases you can switch based on that. https://docs.prefect.io/core/concepts/persistence.html#output-caching-based-on-a-file-target
    a

    as

    2 years ago
    Okay, I look into that in more detail. So I want to make it conditional on if a upstream task is trigger. I should template the target based on this. Eg by templating this target with the creation date of the upstream target file.