potiuk commented on code in PR #34269:
URL: https://github.com/apache/airflow/pull/34269#discussion_r1321449231
##########
dev/breeze/src/airflow_breeze/commands/setup_commands.py:
##########
@@ -269,6 +271,24 @@ def dict_hash(dictionary: dict[str, Any]) -> str:
return dhash.hexdigest()
+def is_common_param(name):
+ return name == "verbose" or name == "help" or name == "dry_run"
+
+
+def validate_params_for_command(command_params, command):
+ global OPTIONS_COMMAND_MAP
+ if "params" in command_params:
+ for param in command_params["params"]:
+ name = param["name"]
+ opts = param["opts"]
+ if not is_common_param(name):
+ for opt in opts:
+ if name not in OPTIONS_COMMAND_MAP:
+ OPTIONS_COMMAND_MAP[opt] = [command]
+ else:
Review Comment:
I think it's not checking what it should be checking. There are two mistakes
here:
a) there is a check for `name` in the map but then opt is added. Effectively
your OPTION_COMMAND_MAP contains no duplicates (and cannot have it)
b) the way it works now is that it was supposed to check if the same "short"
flag is used in several commands. But this is fine and should be perfectly ok.
What we want to check if a command contains more than one option with the same
"short" variant.
Currentlly it checks if the same (short) option is used in more than one
command
--
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]