This is an automated email from the ASF dual-hosted git repository.

henry3260 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b9d52f770c3 Remove dead type-mismatched guard in airflow-ctl command 
generation (#70945)
b9d52f770c3 is described below

commit b9d52f770c373d86e7d7195556b525a4fce49f31
Author: rjgoyln <[email protected]>
AuthorDate: Wed Sep 2 22:39:43 2026 +0800

    Remove dead type-mismatched guard in airflow-ctl command generation (#70945)
    
    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.
---
 airflow-ctl/src/airflowctl/ctl/cli_config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow-ctl/src/airflowctl/ctl/cli_config.py 
b/airflow-ctl/src/airflowctl/ctl/cli_config.py
index 8a2bfd2e15b..d6d22bfacc8 100755
--- a/airflow-ctl/src/airflowctl/ctl/cli_config.py
+++ b/airflow-ctl/src/airflowctl/ctl/cli_config.py
@@ -709,8 +709,8 @@ class CommandFactory:
         """Create Arg for non-primitive type Pydantic."""
         parameter_type_map = getattr(generated_datamodels, parameter_type)
         commands = []
-        if parameter_type_map not in self.datamodels_extended_map.keys():
-            self.datamodels_extended_map[parameter_type] = []
+        # Rebuilt per visit: datamodels are shared across operations, so 
appending would duplicate fields.
+        self.datamodels_extended_map[parameter_type] = []
         for field, field_type in parameter_type_map.model_fields.items():
             if field in self.excluded_parameters:
                 continue

Reply via email to