j

    John Ramirez

    2 years ago
    Hey everyone - I am trying to use the
    result_handler
    with an
    @task
    with no success. Does anyone have a good example to demonstrate how to code it
    Chris White

    Chris White

    2 years ago
    Hi John - could you share some more detail about what isn’t working?
    j

    John Ramirez

    2 years ago
    im pulling from an API in a mapping operation and rather than uploading the results to s3 manually, I want to use the result handler to do it for me
    but in the testing the results are not being stored in s3
    Chris White

    Chris White

    2 years ago
    if you are running in Core alone, result handlers are rarely called; in this case you will want to set
    @task(checkpoint=True)
    on your task as well as set the environment variable
    PREFECT__FLOWS__CHECKPOINTING=true
    . This is outlined here: https://docs.prefect.io/core/concepts/persistence.html#checkpointing
    j

    John Ramirez

    2 years ago
    what about in the cloud?
    Chris White

    Chris White

    2 years ago
    At this moment, all you need to do is set
    checkpoint=True
    to ensure your task’s result handlers are called in Cloud. With the release of Core 0.9.0 checkpointing will become default behavior, so your tasks will always have their result handlers called