You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jack (JIRA)" <ji...@apache.org> on 2019/07/03 10:29:00 UTC

[jira] [Commented] (AIRFLOW-883) Assigning operator to DAG via bitwise composition does not pickup default args

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

jack commented on AIRFLOW-883:
------------------------------

I can confirm that the described issue still relevant in 1.10.3

Switching from context manager back to dag=dag resolved the issue.

For me it happened only on PythonOperator which calls a python callable and in the python callable tried to call another Operator.

> Assigning operator to DAG via bitwise composition does not pickup default args
> ------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-883
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-883
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: models
>            Reporter: Daniel Huang
>            Assignee: Jeremiah Lowin
>            Priority: Minor
>
> This is only the case when the operator does not specify {{dag=dag}} and is not initialized within a DAG's context manager (due to https://github.com/apache/incubator-airflow/blob/fb0c5775cda4f84c07d8d5c0e6277fc387c172e6/airflow/utils/decorators.py#L50)
> Example:
> {code}
> default_args = {
>     'owner': 'airflow', 
>     'start_date': datetime(2017, 2, 1)
> }
> dag = DAG('my_dag', default_args=default_args)
> dummy = DummyOperator(task_id='dummy')
> dag >> dummy
> {code}
> This will raise a {{Task is missing the start_date parameter}}. I _think_ this should probably be allowed because I assume the purpose of supporting {{dag >> op}} was to allow delayed assignment of an operator to a DAG. 
> I believe to fix this, on assignment, we would need to go back and go through dag.default_args to see if any of those attrs weren't explicitly set on task...not the cleanest. 



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