https://prefect.io logo
#prefect-community
Title
# prefect-community
r

Riley Hun

08/12/2020, 6:41 PM
Hello - I'm getting the following error:
ValueError: Task <Task: ThinkNumGetHistoryTask> has retry settings but some upstream dependencies do not have result types
Would anyone know how to address this error? I tried adding retry to all the tasks in the flow, but didn't seem to resolve the issue.
My flow looks like this:
Copy code
token_task = ThinkNumGetTokenTask(
    max_retries=3,
    retry_delay=timedelta(seconds=10)
)

history_task = ThinkNumGetHistoryTask(
    max_retries=3,
    retry_delay=timedelta(seconds=10)
)

with Flow("thinknum-etl") as flow:

    token = token_task(
        version=version
    )

    history = history_task(
        dataset_id=dataset_id,
        version=version,
        token=token
    )
j

josh

08/12/2020, 6:45 PM
Hi @Riley Hun this is due to the assumption that in order to retry a task the upstream result needs to be persisted somewhere so when it attempts to retry it can grab that data to start the task run. You can read more about results here: https://docs.prefect.io/core/concepts/results.html#persisting-results I do however also think that that shouldn’t be a ValueError and instead should only raise a warning because retries have the potential to occur in the same process where the data already lives. I’m going to make a PR for that real quick
r

Riley Hun

08/12/2020, 6:54 PM
Thanks @josh! Appreciate it. Looks like I'll have to start persisting my results for my tasks. But in this example [1], how come we don't have to persist the upstream result? [1] https://docs.prefect.io/core/examples/retries_with_mapping.html
So I did something like this:
Copy code
token_task = ThinkNumGetTokenTask(
    max_retries=3,
    retry_delay=timedelta(seconds=10),
    result=GCSResult(bucket='prefect')
)

history_task = ThinkNumGetHistoryTask(
    max_retries=3,
    retry_delay=timedelta(seconds=10)
)
which I can confirm has resolved the aforementioned error.