You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Aizhamal Nurmamat kyzy (JIRA)" <ji...@apache.org> on 2019/05/17 22:19:03 UTC
[jira] [Updated] (AIRFLOW-881) Create SubDagOperator within DAG
context manager without passing dag param
[ https://issues.apache.org/jira/browse/AIRFLOW-881?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aizhamal Nurmamat kyzy updated AIRFLOW-881:
-------------------------------------------
Labels: subdag (was: )
Adding 'operators' component and 'subdag' label for component refactor.
> Create SubDagOperator within DAG context manager without passing dag param
> --------------------------------------------------------------------------
>
> Key: AIRFLOW-881
> URL: https://issues.apache.org/jira/browse/AIRFLOW-881
> Project: Apache Airflow
> Issue Type: Improvement
> Components: operators, subdag
> Reporter: Daniel Huang
> Assignee: Daniel Huang
> Priority: Trivial
> Labels: subdag
> Fix For: 1.9.0
>
>
> Currently, the following raises a {{Please pass in the `dag` param}} exception:
> {code}
> with DAG('my_dag', default_args=default_args) as dag:
> op = SubDagOperator(task_id='my_subdag', subdag=subdag_factory(...))
> {code}
> But the SubDagOperator should be aware if it's in the context manager of a dag without having to specify {{dag=dag}} when initializing the operator. Similar to how the {{@apply_defaults}} decorator does it (https://github.com/apache/incubator-airflow/blob/fb0c5775cda4f84c07d8d5c0e6277fc387c172e6/airflow/utils/decorators.py#L50).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)