UI: Fix grid columns vanishing when a Dag version has been cleaned - #73514
Open
Eason09053360 wants to merge 1 commit into
Open
Eason09053360 wants to merge 1 commit into
Eason09053360 wants to merge 1 commit into
Conversation
`_get_serdag` is declared `SerializedDAG | None` and logs when it returns None, but the caller guarded it with `if TYPE_CHECKING: assert serdag`, which never executes at runtime. Once `airflow db clean` removes a version's serialized Dag row, the resulting AttributeError is raised inside the `StreamingResponse` generator -- after the 200 has been sent. The client gets a silently truncated NDJSON body and loses every run queued behind the failing one, with no status code to detect it by. The guard was a real `raise HTTPException(404)` until apache#52302 replaced it with the no-op assert. A 404 is no longer available that far into the stream, and skipping the run would hide task instances that are still in the database, so an unresolvable version now falls through to the flat-node path the endpoint already uses for tasks the current structure no longer contains. That makes the missing serialized Dag an expected, handled condition, and the grid re-streams every visible run on each auto-refresh, so its log drops from error to warning -- matching the existing sites for the same condition in models/taskinstance.py.
Eason09053360
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
September 22, 2026 02:38
This branch has not been deployed
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
_get_serdagreturnsSerializedDAG | None, but the caller guarded it withif TYPE_CHECKING: assert serdag, which never runs. Afterairflow db cleanremoves a version's serialized Dag row, theAttributeErrorfires inside theStreamingResponsegenerator once the 200 is already sent: the client gets a silently truncated NDJSON body and loses every run queued behind the failing one. This was a realraise HTTPException(404)until #52302.What
routes/ui/grid.py: an unresolvable version now falls through to the flat-node path already used for tasks missing from the current structure. A 404 is no longer possible mid-stream, and skipping the run would hide task instances that still exist.errortowarning, matchingmodels/taskinstance.py. It still fires per affected run per auto-refresh — happy to dedupe per request if preferred.test_grid.py; both fail without the fix.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines