Skip to content

Implement Cluster 1 Lakeflow control-flow fidelity - #24

Merged
engineeringmadness merged 6 commits into
masterfrom
cursor/lakeflow-cluster1-control-flow-fb3a
Sep 4, 2026
Merged

Implement Cluster 1 Lakeflow control-flow fidelity#24
engineeringmadness merged 6 commits into
masterfrom
cursor/lakeflow-cluster1-control-flow-fb3a

Conversation

@engineeringmadness

@engineeringmadness engineeringmadness commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Implement Cluster 1 from docs/superpowers/specs/2026-09-03-spark-write-lakeflow-roadmap-design.md (T1–T6). Each item was implemented, covered with tests, and the full suite stayed green.

T1 — taskValues: dbutils.jobs.taskValues.set / .get with a runner-scoped store, seeded from base_parameters. Shared workflow tasks see values immediately; isolated notebook.run() buffers set until return.

T2 — run_if / depends_on outcome: ALL_SUCCESS, ALL_FAILED, AT_LEAST_ONE_SUCCESS, ALL_DONE, NONE_FAILED, AT_LEAST_ONE_FAILED. Ineligible tasks are SKIPPED. Failures no longer abort the scheduler immediately; remaining eligible tasks run, then the first error is re-raised.

T3 — condition_task: Evaluate EQUAL/EQUAL_TO, NOT_EQUAL, GREATER_THAN, etc. over literals, {{tasks.<key>.values.<name>}}, and {{job.parameters.<name>}}. Matching depends_on[].outcome (true/false) runs; the other branch is skipped. DAG nodes are task keys.

T4 — for_each_task: Sequential expansion of JSON/list/taskValues inputs. Nested notebook runs once per input with {{input}} params and env isolation. First child failure fails the parent (no later iterations). concurrency is accepted, not parallelized.

T5 — repair-and-rerun: run_workflow(only=[...]) and from_task=. Unselected tasks are treated as SUCCESS. README documents overwrite vs append repair.

T6 — retries / timeouts: max_retries and min_retry_interval_millis retry notebook and for_each tasks. timeout_seconds is logged and not enforced.

Verification: python3.14 -m coverage run -m pytest tests/ -v243 passed.

Open in Web Open in Cursor 

cursoragent and others added 6 commits September 4, 2026 15:20
Add dbutils.jobs.taskValues set/get backed by a runner-scoped store,
seeded from base_parameters. Shared workflow tasks see values immediately;
isolated notebook.run() buffers sets until the child returns.

Co-authored-by: Karan Gupta <engineeringmadness@users.noreply.github.com>
Parse task-level run_if and depends_on outcome, skip ineligible tasks
as SKIPPED, and continue the DAG after failures so ALL_FAILED / ALL_DONE
downstream tasks can still run. Re-raise the first task error at the end.

Co-authored-by: Karan Gupta <engineeringmadness@users.noreply.github.com>
Allow condition_task without a notebook, evaluate EQUAL/NOT_EQUAL/
GREATER_THAN (and Databricks EQUAL_TO aliases) over literals, taskValues,
and job parameters, then skip the non-matching branch via depends_on outcome.
DAG nodes are now task keys so condition tasks can participate in topology.

Co-authored-by: Karan Gupta <engineeringmadness@users.noreply.github.com>
Parse for_each_task inputs (JSON list, literal list, or taskValues),
run the nested notebook once per input with {{input}} params, isolate
env between iterations, and fail the parent task on the first child error.
Concurrency is accepted but iterations run sequentially.

Co-authored-by: Karan Gupta <engineeringmadness@users.noreply.github.com>
Allow run_workflow(only=[...]) and run_workflow(from_task=...) to re-run a
subgraph. Unselected tasks are treated as SUCCESS so depends_on still
resolves. Document overwrite vs append repair idempotency in the README.

Co-authored-by: Karan Gupta <engineeringmadness@users.noreply.github.com>
Parse max_retries, min_retry_interval_millis, and timeout_seconds from
workflow JSON. Retry failed notebook and for_each tasks with optional
sleep; log timeout_seconds without enforcing it. Document Cluster 1
control-flow extras in the README.

Co-authored-by: Karan Gupta <engineeringmadness@users.noreply.github.com>
@engineeringmadness
engineeringmadness marked this pull request as ready for review September 4, 2026 15:31
@engineeringmadness
engineeringmadness merged commit 7f4b523 into master Sep 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants