@@ -42,6 +42,7 @@ def __init__(
4242 min_success_ratio : Optional [float ] = None ,
4343 bound_inputs : Optional [Set [str ]] = None ,
4444 bound_inputs_values : Optional [Dict [str , Any ]] = None ,
45+ run_all_sub_nodes : bool = False ,
4546 ** kwargs ,
4647 ):
4748 """
@@ -51,6 +52,7 @@ def __init__(
5152 :param min_success_ratio: The minimum ratio of successful executions
5253 :param bound_inputs: The set of inputs that should be bound to the map task
5354 :param bound_inputs_values: Inputs that are bound to the array node and will not be mapped over
55+ :param run_all_sub_nodes: If True, all sub-nodes will run to completion even after the failure threshold is met
5456 :param kwargs: Additional keyword arguments to pass to the base class
5557 """
5658 self ._partial = None
@@ -113,6 +115,7 @@ def __init__(
113115 self ._concurrency : Optional [int ] = concurrency
114116 self ._min_successes : Optional [int ] = min_successes
115117 self ._min_success_ratio : Optional [float ] = min_success_ratio
118+ self ._run_all_sub_nodes : bool = run_all_sub_nodes
116119 self ._collection_interface = collection_interface
117120
118121 self ._execution_mode : _core_workflow .ArrayNode .ExecutionMode = _core_workflow .ArrayNode .FULL_STATE
@@ -168,6 +171,10 @@ def min_successes(self) -> Optional[int]:
168171 def concurrency (self ) -> Optional [int ]:
169172 return self ._concurrency
170173
174+ @property
175+ def run_all_sub_nodes (self ) -> bool :
176+ return self ._run_all_sub_nodes
177+
171178 @property
172179 def python_function_task (self ) -> Union [PythonFunctionTask , PythonInstanceTask ]:
173180 return self ._run_task
@@ -385,6 +392,7 @@ def map_task(
385392 concurrency : Optional [int ] = None ,
386393 min_successes : Optional [int ] = None ,
387394 min_success_ratio : float = 1.0 ,
395+ run_all_sub_nodes : bool = False ,
388396 ** kwargs ,
389397):
390398 """
@@ -398,6 +406,7 @@ def map_task(
398406 array node will inherit parallelism from the workflow
399407 :param min_successes: The minimum number of successful executions
400408 :param min_success_ratio: The minimum ratio of successful executions
409+ :param run_all_sub_nodes: If True, all sub-nodes will run to completion even after the failure threshold is met
401410 """
402411 from flytekit .remote import FlyteLaunchPlan
403412
@@ -407,12 +416,14 @@ def map_task(
407416 concurrency = concurrency ,
408417 min_successes = min_successes ,
409418 min_success_ratio = min_success_ratio ,
419+ run_all_sub_nodes = run_all_sub_nodes ,
410420 )
411421 return array_node_map_task (
412422 task_function = target ,
413423 concurrency = concurrency ,
414424 min_successes = min_successes ,
415425 min_success_ratio = min_success_ratio ,
426+ run_all_sub_nodes = run_all_sub_nodes ,
416427 ** kwargs ,
417428 )
418429
@@ -422,6 +433,7 @@ def array_node_map_task(
422433 concurrency : Optional [int ] = None ,
423434 # TODO why no min_successes?
424435 min_success_ratio : float = 1.0 ,
436+ run_all_sub_nodes : bool = False ,
425437 ** kwargs ,
426438):
427439 """Map task that uses the ``ArrayNode`` construct..
@@ -437,8 +449,15 @@ def array_node_map_task(
437449 array node will inherit parallelism from the workflow
438450 :param min_success_ratio: If specified, this determines the minimum fraction of total jobs which can complete
439451 successfully before terminating this task and marking it successful.
452+ :param run_all_sub_nodes: If True, all sub-nodes will run to completion even after the failure threshold is met.
440453 """
441- return ArrayNodeMapTask (task_function , concurrency = concurrency , min_success_ratio = min_success_ratio , ** kwargs )
454+ return ArrayNodeMapTask (
455+ task_function ,
456+ concurrency = concurrency ,
457+ min_success_ratio = min_success_ratio ,
458+ run_all_sub_nodes = run_all_sub_nodes ,
459+ ** kwargs ,
460+ )
442461
443462
444463class ArrayNodeMapTaskResolver (tracker .TrackedInstance , TaskResolverMixin ):
0 commit comments