Hey everyone - I am trying to use the `result_hand...
# ask-community
j
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
c
Hi John - could you share some more detail about what isn’t working?
j
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
c
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
what about in the cloud?
c
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