This is an automated email from the ASF dual-hosted git repository.

shahar1 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 5f8b01416ea Remove unused CLI Dag file location loader (#75779)
5f8b01416ea is described below

commit 5f8b01416ea88f7ff9510c2a94e40b96071bc331
Author: Hussein Awala <[email protected]>
AuthorDate: Tue Oct 27 22:03:59 2026 +0100

    Remove unused CLI Dag file location loader (#75779)
    
    CLI Dag loading now uses the bundle-aware loading helpers. The older 
unregistered file-location loader has no callers, leaving its AIP-66 migration 
TODO without an active path to migrate.
---
 airflow-core/src/airflow/utils/cli.py  | 17 -----------------
 generated/known_airflow_exceptions.txt |  2 +-
 2 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/airflow-core/src/airflow/utils/cli.py 
b/airflow-core/src/airflow/utils/cli.py
index 165c26c8b72..04461f06359 100644
--- a/airflow-core/src/airflow/utils/cli.py
+++ b/airflow-core/src/airflow/utils/cli.py
@@ -531,23 +531,6 @@ def process_subdir(subdir: str | None):
     return subdir
 
 
-def get_dag_by_file_location(dag_id: str):
-    """Return DAG of a given dag_id by looking up file location."""
-    # TODO: AIP-66 - investigate more, can we use serdag?
-    from airflow.dag_processing.dagbag import DagBag
-    from airflow.models import DagModel
-
-    # Benefit is that logging from other dags in dagbag will not appear
-    dag_model = DagModel.get_current(dag_id)
-    if dag_model is None:
-        raise AirflowException(
-            f"Dag {dag_id!r} could not be found; either it does not exist or 
it failed to parse."
-        )
-    # This method is called only when we explicitly do not have a bundle name
-    dagbag = DagBag(dag_folder=dag_model.fileloc)
-    return dagbag.dags[dag_id]
-
-
 def _search_for_dag_file(val: str | None) -> str | None:
     """
     Search for the file referenced at fileloc.
diff --git a/generated/known_airflow_exceptions.txt 
b/generated/known_airflow_exceptions.txt
index c0c0e91a5dc..ecf8a7634ce 100644
--- a/generated/known_airflow_exceptions.txt
+++ b/generated/known_airflow_exceptions.txt
@@ -16,7 +16,7 @@ airflow-core/src/airflow/serialization/definitions/dag.py::1
 airflow-core/src/airflow/serialization/json_schema.py::1
 airflow-core/src/airflow/serialization/serialized_objects.py::2
 airflow-core/src/airflow/ti_deps/deps/valid_state_dep.py::1
-airflow-core/src/airflow/utils/cli.py::4
+airflow-core/src/airflow/utils/cli.py::3
 airflow-core/src/airflow/utils/db.py::1
 airflow-core/src/airflow/utils/db_cleanup.py::1
 airflow-core/src/airflow/utils/db_manager.py::3

Reply via email to