Skip to content

Commit

Permalink
Remove flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil committed Jan 2, 2024
1 parent 7ce1c0c commit d76891e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
9 changes: 0 additions & 9 deletions airflow/cli/cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,6 @@ def string_lower_type(val):
),
action="store_true",
)
ARG_FAIL_ON_DAGRUN_FAILURE = Arg(
(
"-f",
"--fail-on-dagrun-failure",
),
help="Exit with code 1 if the DagRun completes with a failed state.\n",
action="store_true",
)
ARG_SAVE_DAGRUN = Arg(
("--save-dagrun",),
help="After completing the backfill, saves the diagram for current DAG Run to the indicated file.\n\n",
Expand Down Expand Up @@ -1256,7 +1248,6 @@ class GroupCommand(NamedTuple):
ARG_SHOW_DAGRUN,
ARG_IMGCAT_DAGRUN,
ARG_SAVE_DAGRUN,
ARG_FAIL_ON_DAGRUN_FAILURE,
ARG_VERBOSE,
),
),
Expand Down
2 changes: 1 addition & 1 deletion airflow/cli/commands/dag_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def dag_test(args, dag: DAG | None = None, session: Session = NEW_SESSION) -> No
if show_dagrun:
print(dot_graph.source)

if args.fail_on_dagrun_failure and dr and dr.state == DagRunState.FAILED:
if dr and dr.state == DagRunState.FAILED:
raise SystemExit("DagRun failed")


Expand Down
4 changes: 1 addition & 3 deletions tests/cli/commands/test_dag_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,7 @@ def test_dag_test_fail_raise_error(self, mock_get_dag):
mock_get_dag.return_value.test.return_value = DagRun(
dag_id="example_bash_operator", execution_date=DEFAULT_DATE, state=DagRunState.FAILED
)
cli_args = self.parser.parse_args(
["dags", "test", "example_bash_operator", execution_date_str, "--fail-on-dagrun-failure"]
)
cli_args = self.parser.parse_args(["dags", "test", "example_bash_operator", execution_date_str])
with pytest.raises(SystemExit, match=r"DagRun failed"):
dag_command.dag_test(cli_args)

Expand Down

0 comments on commit d76891e

Please sign in to comment.