Skip to content

Commit

Permalink
fix exception when dag labels is none
Browse files Browse the repository at this point in the history
  • Loading branch information
elephantum committed Feb 13, 2021
1 parent e3efa78 commit 3c628f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow_exporter/prometheus_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ def get_dag_labels(dag_id):
return [], []

labels = dag.params.get('labels')
labels = {k:v for k,v in labels.items() if not k.startswith('__')}

if labels is None:
return [], []

labels = {k:v for k,v in labels.items() if not k.startswith('__')}
return list(labels.keys()), list(labels.values())


Expand Down

0 comments on commit 3c628f3

Please sign in to comment.