Repository navigation
Java SDK: Draw a Java-authored Dag's edges with before and after - #73594
Merged
jason810496 merged 2 commits intoSep 26, 2026
Merged
Conversation
This was referenced Sep 23, 2026
jason810496
force-pushed
the
feature/java-sdk-native-dag-edges
branch
from
September 24, 2026 05:31
bea463f to
77efec6
Compare
jason810496
force-pushed
the
feature/java-sdk-native-dag-edges
branch
3 times, most recently
from
September 24, 2026 13:36
ed62367 to
d84462c
Compare
A Dag authored in Java had no way to say what runs after what. Without a Python Dag file to hold the graph, every task was a root, so a Dag that Java owns end to end could not be expressed at all. The verbs are before and after, matching the TypeScript SDK, and leaving then free for the conditional control flow that reads as a then-branch. They are the only way to draw an edge, so one graph has one spelling however it was built.
uranusjr
force-pushed
the
feature/java-sdk-native-dag-edges
branch
from
September 26, 2026 01:25
d84462c to
9c1af34
Compare
Member
|
Since the dependent PR has been merged, I took the liberty to rebase this against main. |
uranusjr
approved these changes
Sep 26, 2026
uranusjr
left a comment
Member
There was a problem hiding this comment.
I added a couple of notes on implementation choices. This now looks good to me. (Pending CI and a final look from Jason.)
uranusjr
marked this pull request as ready for review
September 26, 2026 09:50
jason810496
commented
Sep 26, 2026
jason810496
left a comment
Member
Author
There was a problem hiding this comment.
Thanks for the update, TP, LTGM.
This was referenced Sep 27, 2026
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Dag authored in Java had no way to say what runs after what. Without a Python Dag file to hold the graph every task was a root, so a Dag that Java owns end to end could not be expressed at all. This is the graph half of ADR-0002.
Example
How
dag.task(...)registers a task as it creates it and hands back the handle, so there is no secondaddTaskto forget.beforeandafterare Java's spelling of Python's>>and<<, named to match the TypeScript SDK and to leavethenfree for the conditional control flow that reads as a then-branch. They are the only way to draw an edge, so one graph has one spelling however it was built.a.before(b, c)fans out andd.after(b, c)fans in, and both return their own receiver: a fan-out has no single next task to hand back.Flow.of(a, b).before(c, d), fromorg.apache.airflow.sdk.Deps.Flow, draws every edge between two sets in one call.Bundle: an upstream that belongs to another Dag, and a cycle anywhere in the graph, both fail there rather than at the first task run. A Dag that fails the check is not added to the bundle.example/.../nativedag/InterfaceExample.javais a Dag with no Python counterpart.Was generative AI tooling used to co-author this PR?