Remove dead type-mismatched guard in airflow-ctl command generation - #70945
Open
rjgoyln wants to merge 1 commit into
Open
Remove dead type-mismatched guard in airflow-ctl command generation#70945rjgoyln wants to merge 1 commit into
rjgoyln wants to merge 1 commit into
Conversation
The condition compared a Pydantic model class against a dict keyed by model name, so it never held. It happened to be load-bearing: it forced the field list to be rebuilt on every visit, which is what kept datamodels shared by several operations (ConnectionBody, VariableBody, BackfillPostBody) from accumulating duplicate entries. Correcting the comparison to match the key type would have silently introduced those duplicates, so the guard is dropped in favour of the unconditional reset it was already performing.
rjgoyln
force-pushed
the
fix-airflowctl-datamodel-field-dedup
branch
from
August 3, 2026 12:18
63ff28a to
fe4414e
Compare
rjgoyln
marked this pull request as ready for review
August 3, 2026 12:29
rjgoyln
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
August 3, 2026 12:29
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.
Summary
The condition guarding this initialisation compares a Pydantic model class against a dict keyed by model name, so it has never been true. The branch is dead code, and has been since it was introduced.
It is deleted rather than repaired because repairing it would be a regression. The field loop beneath appends unconditionally, so the always-taken reset is what keeps datamodels that several operations share —
ConnectionBodyacross three,BackfillPostBodyandVariableBodyacross two — from accumulating a duplicate copy of their fields on every visit: a type-correct comparison expandsConnectionBodyto 27 entries instead of 9.Nothing changes at runtime, and the duplicates a repair would introduce are consumed idempotently, so this is a readability fix — it removes a condition that reads as live logic and invites the wrong correction.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines