[ 
https://issues.apache.org/jira/browse/AIRFLOW-4490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16859835#comment-16859835
 ] 

Ash Berlin-Taylor commented on AIRFLOW-4490:
--------------------------------------------

Jira is pretty forgiving about nulls I think. Can you do this as
{{ dag_run.conf.value | default(ts }}
 

> dag_run.conf should be an empty dictionary by default
> -----------------------------------------------------
>
>                 Key: AIRFLOW-4490
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4490
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: DagRun
>            Reporter: Omer Yampel
>            Assignee: Omer Yampel
>            Priority: Trivial
>
> Currently, if no conf is provided when running a dag, the `dag_run.conf` 
> instance is None. 
> When a DAG might not always be triggered with a configuration, this leads to 
> needing to handle an "empty" configuration like this :
> {code}
> {{ if dag_run.conf and dag_run.conf.get('value') and ... }}
> {code}
> If dag_run.conf was an empty dictionary by default, this could simply become:
> {code}
> {{ if dag_run.conf.get('key') and ....}}
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to