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

David Dossett commented on AIRFLOW-733:
---------------------------------------

These two issues are near duplicates I believe. In both cases it seems that 
deferred DAG assignment doesn't go back and re-apply the default args of the 
DAG to the Operator (since the Operator's __init__ has already been run). 
Confusing behaviour, but maybe not a 'bug'.

I encountered this when I didn't assign a DAG to an operator but did set its 
upstream task (which now automatically adds it to the correct DAG) and the 
default owner 'airflow' was showing up as the Operator owner. instead of the 
one in the DAG's default_args.

> Deferred DAG assignment breaks with default_args
> ------------------------------------------------
>
>                 Key: AIRFLOW-733
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-733
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: models
>            Reporter: George Sakkis
>            Priority: Minor
>
> Deferred DAG assignment raises {{AirflowException}} if the dag has 
> {{default_args}} instead of {{start_date}}:
> {noformat}
> default_args = {'start_date': datetime(2016, 1, 1)}
> dag = DAG('my_dag2', default_args=default_args)
> deferred_op = DummyOperator(task_id='dummy')
> deferred_op.dag = dag
> ---------------------------------------------------------------------------
> AirflowException                          Traceback (most recent call last)
> <ipython-input-7-d9ff2f9c7283> in <module>()
> ----> 1 deferred_op.dag = dag
> ...
> AirflowException: Task is missing the start_date parameter
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to