Skip to content

Commit

Permalink
Fix issue with cross-join in DB in function.
Browse files Browse the repository at this point in the history
Fix issue with xcom value is not returned as an object
  • Loading branch information
Konstantin Mitckevich committed Jun 29, 2021
1 parent 078a151 commit 08c650b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions airflow_prometheus_exporter/prometheus_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def get_dag_duration_info():
),
)
.filter(
TaskInstance.start_date.isnot(None),
TaskInstance.end_date.isnot(None),
dag_start_dt_query.c.start_date.isnot(None),
DagRun.end_date.isnot(None),
)
.all()
)
Expand Down Expand Up @@ -446,7 +446,8 @@ def collect(self):
for tasks in xcom_config.get("xcom_params", []):
for param in get_xcom_params(tasks["task_id"]):
xcom_value = extract_xcom_parameter(param.value)

if not isinstance(xcom_value, dict):
xcom_value = {xcom_value: xcom_value}
if tasks["key"] in xcom_value:
xcom_params.add_metric(
[param.dag_id, param.task_id], xcom_value[tasks["key"]]
Expand Down

0 comments on commit 08c650b

Please sign in to comment.