Skip to content

Commit 620e6e7

Browse files
potiukephraimbuddy
authored andcommitted
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 01b69d3)
1 parent 8d6efad commit 620e6e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dev/breeze/src/airflow_breeze/commands/setup_commands.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def find_options_in_options_list(option: str, option_list: list[list[str]]) -> i
492492
return None
493493

494494

495-
def check_params(command: str, subcommand: str | None, command_dict: dict[str, Any]) -> bool:
495+
def errors_detected_in_params(command: str, subcommand: str | None, command_dict: dict[str, Any]) -> bool:
496496
import rich_click
497497

498498
get_console().print(
@@ -508,7 +508,7 @@ def check_params(command: str, subcommand: str | None, command_dict: dict[str, A
508508
f"defined in rich click configuration."
509509
)
510510
get_console().print(f"[warning]Please add it to the `{command_path_config(command)}`.")
511-
return False
511+
return True
512512
rich_click_param_groups = options[rich_click_key]
513513
defined_param_names = [
514514
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:
567567
if "commands" in current_command_dict:
568568
subcommands = current_command_dict["commands"]
569569
for subcommand in sorted(subcommands.keys()):
570-
if check_params(command, subcommand, subcommands[subcommand]):
570+
if errors_detected_in_params(command, subcommand, subcommands[subcommand]):
571571
errors_detected = True
572572
else:
573-
if check_params(command, None, current_command_dict):
573+
if errors_detected_in_params(command, None, current_command_dict):
574574
errors_detected = True
575575
return 1 if errors_detected else 0
576576

0 commit comments

Comments
 (0)