Hedgar
03/04/2022, 6:59 PMKevin Kho
03/04/2022, 7:31 PMraise FAILED()
to fail the task. We don’t have retries on the flow level but we do have for task level if you want thatHedgar
03/05/2022, 2:03 PM@task(name=‘extract symbol’)
def extract_symbol():
Something here…
@task(name=“extract index”)
def extract_index():
Something here …
@task(name=“combine”)
def combine(sym indx ):
coby = pd.merge(sym,inx)
if coby[0][-1] == “MUKY”:
coby
else:
raise ValueError(“there has been an incomplete data extract”)
with Flow():
syb = extract_symbol()
inx = extract_index()
combine(syb, inx)
what strategy can I use to ensure that the whole code run again during retry when it failed?Kevin Kho
03/05/2022, 2:09 PMset_task_run_state
mutation in order to mark it as FailedHedgar
03/05/2022, 7:35 PMfrom prefect.engine import signals
if coby[0][-1] != “MURKY”:
raise signals.RETRY()
else:
coby
according to the docs this would force a retry?Kevin Kho
03/05/2022, 8:55 PMHedgar
03/06/2022, 8:13 AM