Skip to content

Commit

Permalink
Moved for each task config validation up
Browse files Browse the repository at this point in the history
  • Loading branch information
riccamini committed Dec 16, 2024
1 parent abbf90b commit 4ff9c13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions brickflow/codegen/databricks_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion brickflow/engine/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ff9c13

Please sign in to comment.