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


##########
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:
   actually it has to be `{k for k, v in collections.Counter([c.name for c in 
airflow_commands]).items() if v > 1}`
   I'll push it in a new commit, battling with tests at the moment.



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