Hi everybody, i am wondering for the `transform ta...
# ask-community
j
Hi everybody, i am wondering for the
transform task
, it is expected to fail for parameter
"a"
, but when i rerun from fail, what is the expected flow? Will it rerun for all cases
[3,1,"a"]
or skip
3,1
, and only rerun
a
Copy code
@task
def extract():
    return [3, 1, "a"]


@task
def transform(x):
    y = x + 1
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>(y)
    return y


with Flow("failure-flow-test", executor=LocalExecutor(), run_config=LocalRun()) as flow:
    e = extract()
    t = transform.map(e)
z
Hi @Jeremy Tee -- to skip the successful tasks you'll need to define a
Result
type to cache the results for those tasks. See https://docs.prefect.io/core/concepts/persistence.html#persisting-output and https://docs.prefect.io/core/concepts/results.html#result-objects
Without a result type defined, the UI will let you restart the flow but it will error.
j
thank youi!