This is an automated email from the ASF dual-hosted git repository. ephraimanierobi pushed a commit to branch v2-5-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 7e0bdb04677fe638f717f5e140b34af97d319289 Author: Jarek Potiuk <[email protected]> AuthorDate: Thu Mar 9 16:39:09 2023 +0100 Return error when group is not defined in breeze configuration (#29997) When group was not found in Breeze configuration, we printed error but did not return error code - thus we missed the fact that some groups were not defined in breeze configuration. (cherry picked from commit 01b69d3021536057a1b08347941f7211c2825d21) --- dev/breeze/src/airflow_breeze/commands/setup_commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/breeze/src/airflow_breeze/commands/setup_commands.py b/dev/breeze/src/airflow_breeze/commands/setup_commands.py index b56b07340a..905bf4652a 100644 --- a/dev/breeze/src/airflow_breeze/commands/setup_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/setup_commands.py @@ -492,7 +492,7 @@ def find_options_in_options_list(option: str, option_list: list[list[str]]) -> i return None -def check_params(command: str, subcommand: str | None, command_dict: dict[str, Any]) -> bool: +def errors_detected_in_params(command: str, subcommand: str | None, command_dict: dict[str, Any]) -> bool: import rich_click get_console().print( @@ -508,7 +508,7 @@ def check_params(command: str, subcommand: str | None, command_dict: dict[str, A f"defined in rich click configuration." ) get_console().print(f"[warning]Please add it to the `{command_path_config(command)}`.") - return False + return True rich_click_param_groups = options[rich_click_key] defined_param_names = [ param["opts"] for param in command_dict["params"] if param["param_type_name"] == "option" @@ -567,10 +567,10 @@ def check_that_all_params_are_in_groups(commands: tuple[str, ...]) -> int: if "commands" in current_command_dict: subcommands = current_command_dict["commands"] for subcommand in sorted(subcommands.keys()): - if check_params(command, subcommand, subcommands[subcommand]): + if errors_detected_in_params(command, subcommand, subcommands[subcommand]): errors_detected = True else: - if check_params(command, None, current_command_dict): + if errors_detected_in_params(command, None, current_command_dict): errors_detected = True return 1 if errors_detected else 0
