You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2024/08/11 03:36:47 UTC
(airflow) 01/01: Just test
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 94d33a90d8aecc4abb251a0645bf3fad00a042d7
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Sun Aug 11 04:34:02 2024 +0100
Just test
---
airflow/api_connexion/endpoints/dag_run_endpoint.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/airflow/api_connexion/endpoints/dag_run_endpoint.py b/airflow/api_connexion/endpoints/dag_run_endpoint.py
index 96fdd42fa0..5ef5b0f5d8 100644
--- a/airflow/api_connexion/endpoints/dag_run_endpoint.py
+++ b/airflow/api_connexion/endpoints/dag_run_endpoint.py
@@ -308,9 +308,12 @@ def post_dag_run(*, dag_id: str, session: Session = NEW_SESSION) -> APIResponse:
if not dm:
raise NotFound(title="DAG not found", detail=f"DAG with dag_id: '{dag_id}' not found")
if dm.has_import_errors:
+ from airflow.models.errors import ParseImportError
+ errors = session.scalars(select(ParseImportError)).all()
+ errors = {error.filename: error.stacktrace for error in errors}
raise BadRequest(
title="DAG cannot be triggered",
- detail=f"DAG with dag_id: '{dag_id}' has import errors",
+ detail=f"DAG with dag_id: '{dag_id}' has import errors: {errors}",
)
try:
post_body = dagrun_schema.load(get_json_request_dict(), session=session)