This is an automated email from the ASF dual-hosted git repository.
henry3260 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new ed5496fe78d Remove unreachable break in get_bagged_dag (#72332)
ed5496fe78d is described below
commit ed5496fe78d608320b39e776d4d147708f695e05
Author: Henry Chen <[email protected]>
AuthorDate: Sat Oct 17 22:34:52 2026 +0800
Remove unreachable break in get_bagged_dag (#72332)
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.
---
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."
)