From 3ea3c56059a984894d2f62025c1f50dfc18042d0 Mon Sep 17 00:00:00 2001 From: smogili1 <36517810+smogili1@users.noreply.github.com> Date: Thu, 27 Dec 2018 09:55:06 -0800 Subject: [PATCH] Update airflow_api.py removing "dags" when instantiating the DagBag class, as it doesn't return any dags if "dags" is included. --- blueprints/airflow_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blueprints/airflow_api.py b/blueprints/airflow_api.py index 2d1f0ab..c3047a1 100644 --- a/blueprints/airflow_api.py +++ b/blueprints/airflow_api.py @@ -99,7 +99,7 @@ def find_dag_runs(session, dag_id, dag_run_id, execution_date): @airflow_api_blueprint.route('/dags', methods=['GET']) def dags_index(): - dagbag = DagBag('dags') + dagbag = DagBag() dags = [] for dag_id in dagbag.dags: payload = { @@ -216,7 +216,7 @@ def create_dag_run(): try: session = settings.Session() - dagbag = DagBag('dags') + dagbag = DagBag() if dag_id not in dagbag.dags: return ApiResponse.bad_request("Dag id {} not found".format(dag_id)) @@ -284,4 +284,4 @@ def get_dag_run(dag_run_id): session.close() - return ApiResponse.success({'dag_run': format_dag_run(dag_run)}) \ No newline at end of file + return ApiResponse.success({'dag_run': format_dag_run(dag_run)})