vandonr-amz commented on code in PR #33423:
URL: https://github.com/apache/airflow/pull/33423#discussion_r1295362936


##########
airflow/cli/cli_parser.py:
##########
@@ -65,6 +65,22 @@
 
 ALL_COMMANDS_DICT: dict[str, CLICommand] = {sp.name: sp for sp in 
airflow_commands}
 
+# Check if sub-commands are defined twice, which could be an issue.
+if len(ALL_COMMANDS_DICT) < len(airflow_commands):
+    seen = set()
+    dup = []
+    for command in airflow_commands:
+        if command.name not in seen:
+            seen.add(command.name)
+        else:
+            dup.append(command.name)
+    log.warning(
+        "The following CLI %d command(s) are defined more than once, "
+        "CLI behavior when using those will be unpredictable: %s",
+        len(dup),
+        dup,
+    )

Review Comment:
   it's more compact but I personally find it less readable.
   (it's also less efficient but that does not matter here)



-- 
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