Skip to content

Commit

Permalink
refactoring changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush-san authored Jan 22, 2020
1 parent cc98d3a commit 15d8a50
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions airflow_prometheus_exporter/prometheus_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ def get_task_failure_counts():
TaskFail.task_id,
func.count(TaskFail.dag_id).label("count"),
)
.join(DagModel, DagModel.dag_id == TaskFail.dag_id, )
.join(DagModel, DagModel.dag_id == TaskFail.dag_id,)
.filter(
DagModel.is_active == True, # noqa
DagModel.is_paused == False,
)
.group_by(TaskFail.dag_id, TaskFail.task_id, )
.group_by(TaskFail.dag_id, TaskFail.task_id,)
)


Expand All @@ -196,8 +196,8 @@ def get_xcom_params(task_id):
and_(
(XCom.dag_id == max_execution_dt_query.c.dag_id),
(
XCom.execution_date
== max_execution_dt_query.c.max_execution_dt
XCom.execution_date
== max_execution_dt_query.c.max_execution_dt
),
),
)
Expand Down Expand Up @@ -239,7 +239,7 @@ def get_task_duration_info():
DagRun.dag_id,
func.max(DagRun.execution_date).label("max_execution_dt"),
)
.join(DagModel, DagModel.dag_id == DagRun.dag_id, )
.join(DagModel, DagModel.dag_id == DagRun.dag_id,)
.filter(
DagModel.is_active == True, # noqa
DagModel.is_paused == False,
Expand Down Expand Up @@ -289,7 +289,7 @@ def get_dag_scheduler_delay():
session.query(
DagRun.dag_id, DagRun.execution_date, DagRun.start_date,
)
.filter(DagRun.dag_id == CANARY_DAG, )
.filter(DagRun.dag_id == CANARY_DAG,)
.order_by(DagRun.execution_date.desc())
.limit(1)
.all()
Expand Down

0 comments on commit 15d8a50

Please sign in to comment.