This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-4-test by this push:
new 6a76fd81348 [v3-4-test] Remove unreachable break in get_bagged_dag
(#72332) (#74981)
6a76fd81348 is described below
commit 6a76fd81348d722ae4ee3f829a485e4cc664b95d
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Oct 18 16:40:39 2026 +0530
[v3-4-test] Remove unreachable break in get_bagged_dag (#72332) (#74981)
The walrus assignment on the preceding line returns as soon as a Dag is
found, so the following `if dag:` is only ever reached when `dag` is
falsy and its `break` can never run. Dropping it also makes the two
bundle loops in this function read the same way.
(cherry picked from commit ed5496fe78d608320b39e776d4d147708f695e05)
Co-authored-by: Henry Chen <[email protected]>
---
airflow-core/src/airflow/utils/cli.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/airflow-core/src/airflow/utils/cli.py
b/airflow-core/src/airflow/utils/cli.py
index fb639364364..f2031f7c93f 100644
--- a/airflow-core/src/airflow/utils/cli.py
+++ b/airflow-core/src/airflow/utils/cli.py
@@ -355,8 +355,6 @@ def get_bagged_dag(
sync_bag_to_db(dagbag, bundle.name, bundle.version)
if dag := dagbag.dags.get(dag_id):
return check_dag(dag)
- if dag:
- break
raise AirflowException(
f"Dag {dag_id!r} could not be found; either it does not exist or it
failed to parse."
)