hey, is there a way to prevent prefect from writin...
# ask-community
c
hey, is there a way to prevent prefect from writing what my tasks return to the results folder? I have checkpointing turned off, and config values in the task below return False.
Copy code
@task(state_handlers=[post_task_fail])
def add_headers(headers: list, data: tuple) -> List:
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>(prefect.config.flows.checkpointing)
    <http://logger.info|logger.info>(prefect.config.tasks.checkpointing)

    return headers + list(data)
*edit: but -> and config values ...
k
Hey @Christian Eik, just trying to get more details. Do you have a Result configured? You have the
Copy code
PREFECT__FLOWS__CHECKPOINTING=false
environment variable? Did you set it on the agent?
c
i added the following lines to my config.toml, which i use for all configuration. didn't change anything
Copy code
[tasks]
    checkpointing = "false"

[flows]
    checkpointing = "false"
i also don't (afaik) have any results configuration. none of my task decorators have result set.
i use a plain local agent with no extra configuration
k
Ok will ask the team
Unfortunately, if you use a backend (server or cloud) we override the config value. You need to set checkpoint = False on each task when you create the flow.
c
ok, let me try that 🙂
k
Just making sure you know how,
@task(checkpoint-False)
c
ok, this did the trick
does this config value get overwritten because it's in the user config.toml? or would it get overwritten no matter how i set it?
k
It gets overwritten no matter what
👍 1
Some people use the same file names to overwrite from run to run
c
yeah, i saw that from some other thread
is it dumb idea to just turn if off for everything?
(am i not actively using the results files afaik, so they were just filling up the disk)
k
You lose the ability to retry from a specific point because that result is retrieved
Otherwise yeah it should be fine
c
hmm, i think that's ok in my case, will keep it in mind though 🙂
thanks for your help 🙂
👍 1