diff --git a/brickflow/codegen/databricks_bundle.py b/brickflow/codegen/databricks_bundle.py index 00fbca6..2f1d227 100644 --- a/brickflow/codegen/databricks_bundle.py +++ b/brickflow/codegen/databricks_bundle.py @@ -784,6 +784,12 @@ def _build_native_for_each_task( TaskType.BRICKFLOW_TASK, # Accounts for brickflow entrypoint tasks ) + if task.for_each_task_conf is None: + raise ValueError( + f"Error while building for each task {task_name}. " + f"Make sure {task_name} has a for_each_task_conf attribute." + ) + nested_task = task.task_func() task_type = self._get_task_type(nested_task) @@ -809,12 +815,6 @@ def _build_native_for_each_task( depends_on=[], ) - if task.for_each_task_conf is None: - raise ValueError( - f"Error while building for each task {task_name}. " - f"Make sure {task_name} has a for_each_task_conf attribute." - ) - for_each_task = ForEachTask( configs=task.for_each_task_conf, task=nested_task_jt, diff --git a/brickflow/engine/task.py b/brickflow/engine/task.py index c904cce..97709b1 100644 --- a/brickflow/engine/task.py +++ b/brickflow/engine/task.py @@ -521,7 +521,6 @@ class ForEachTask(JobsTasksForEachTask): to be able to execute multiple runs of the task concurrently task (Any): The task that will be run for each element in the array - TODO riccamini: Add examples """ configs: JobsTasksForEachTaskConfigs