https://prefect.io logo
Title
k

Kelvin Garcia

09/12/2022, 7:20 PM
Hi all, I see in the docs (https://docs-v1.prefect.io/core/concepts/persistence.html#input-caching) that prefect does automatic input caching, so in this case I have a task that returns a dict
{
        "jobId": reportId,
        "s3Location": s3Location,
        "validationSettings": validation_settings,
    }
but when the flow fails and I need to restart a task that uses that dict as a dependency I get this error
reportId = settings["jobId"]
TypeError: 'NoneType' object is not subscriptable
why the second time I run that task the input is
None
, shouldn't it cache the input for restarts?
1
m

Mason Menges

09/12/2022, 7:38 PM
Hey @Kelvin Garcia I believe in this case you would need to make sure results are configured for your tasks, this discourse article is for retries but similar concepts apply here I believe https://discourse.prefect.io/t/why-results-need-to-be-configured-in-order-to-use-retries/867