rjgoyln opened a new pull request, #70945:
URL: https://github.com/apache/airflow/pull/70945

   `_create_arg_for_non_primitive_type` guarded the initialisation of
   `datamodels_extended_map` with a condition that could never hold:
   
   ```python
   parameter_type_map = getattr(generated_datamodels, parameter_type)   # a 
Pydantic model class
   if parameter_type_map not in self.datamodels_extended_map.keys():    # dict 
is keyed by model *name*
   ```
   
   The map is keyed by the model name, so comparing the class object against
   those keys is always `True`.
   
   The dead guard turned out to be load-bearing. The field loop beneath it
   appends unconditionally, so the always-taken reset was the only thing
   keeping datamodels that several operations share — `ConnectionBody`
   (3 operations), `BackfillPostBody` and `VariableBody` (2 each) — from
   accumulating a duplicate copy of their fields on every visit. Repairing
   the comparison to match the key type would therefore have introduced the
   duplication rather than removed it (`ConnectionBody` expands to 27
   entries instead of 9).
   
   The guard is dropped in favour of the unconditional reset it was already
   performing, so behaviour is unchanged and the intent is now honest.
   
   Because the change is behaviour-preserving, the accompanying test passes
   against both the old and the new code — it exists to fail against the
   plausible-looking "fix" above, which is the trap this code invites. It
   asserts the exact expected field list rather than merely the absence of
   duplicates, so it also pins completeness and ordering.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to