rich-garden-69988
02/17/2023, 12:13 AMrich-garden-69988
02/17/2023, 12:24 AMfrom flytekit import dynamic, task, workflow
@task(retries=2)
def test_task(x: int) -> int:
raise Exception
return x
@dynamic
def test_task_dynamic(x: int) -> int:
return test_task(x=x)
@workflow
def test_workflow_dynamic(x: int) -> int:
return test_task_dynamic(x=x)
^ In this case, the test_task
retries multiple timesrich-garden-69988
02/17/2023, 12:35 AMfrom flytekit import dynamic, task, workflow
from flytekit.exceptions.user import FlyteRecoverableException
@task(retries=2)
def test_task(x: int) -> int:
try:
...
except KnownException:
raise
except Exception as e:
raise FlyteRecoverableException("Other error") from e
return x
@dynamic(retries=0)
def test_task_dynamic(x: int) -> int:
return test_task(x=x)
@workflow
def test_workflow_dynamic(x: int) -> int:
return test_task_dynamic(x=x)