Fix recursion check

This commit is contained in:
Nuno Campos
2024-05-07 07:57:36 -07:00
parent a1e55855fb
commit f4a4b98946
+12 -12
View File
@@ -712,12 +712,6 @@ class Pregel(
raise ValueError("No tasks to run in graph.")
else:
break
elif step == config["recursion_limit"]:
raise GraphRecursionError(
f"Recursion limit of {config['recursion_limit']} reached"
"without hitting a stop condition. You can increase the "
"limit by setting the `recursion_limit` config key."
)
# before execution, check if we should interrupt
if _should_interrupt(
@@ -837,6 +831,12 @@ class Pregel(
next_tasks,
):
break
else:
raise GraphRecursionError(
f"Recursion limit of {config['recursion_limit']} reached"
"without hitting a stop condition. You can increase the "
"limit by setting the `recursion_limit` config key."
)
# set final channel values as run output
run_manager.on_chain_end(read_channels(channels, output_keys))
@@ -980,12 +980,6 @@ class Pregel(
raise ValueError("No tasks to run in graph.")
else:
break
elif step == config["recursion_limit"]:
raise GraphRecursionError(
f"Recursion limit of {config['recursion_limit']} reached"
"without hitting a stop condition. You can increase the limit"
"by setting the `recursion_limit` config key."
)
# before execution, check if we should interrupt
if _should_interrupt(
@@ -1116,6 +1110,12 @@ class Pregel(
next_tasks,
):
break
else:
raise GraphRecursionError(
f"Recursion limit of {config['recursion_limit']} reached"
"without hitting a stop condition. You can increase the limit"
"by setting the `recursion_limit` config key."
)
# set final channel values as run output
await run_manager.on_chain_end(read_channels(channels, output_keys))