Repository navigation
UI: Fix grid columns vanishing when a Dag version has been cleaned - #73514
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.
|
Hello @Eason09053360 - thank you for your contributions to Apache Airflow! The Airflow community has introduced a limit of 5 open pull requests at a time for contributors without write access to the repository. You currently have 33 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
This is not a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are. What we ask you to do is to make your first prioritization decision: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack. Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst. Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting |
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