airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Muthuraj Ramasamy (JIRA)" <>
Subject [jira] [Created] (AIRFLOW-1048) SubDagOperator to have xcom output based on its tasks
Date Mon, 27 Mar 2017 23:26:41 GMT
Muthuraj Ramasamy created AIRFLOW-1048:

             Summary: SubDagOperator to have xcom output based on its tasks
                 Key: AIRFLOW-1048
             Project: Apache Airflow
          Issue Type: New Feature
          Components: subdag
    Affects Versions: Airflow 2.0, Airflow 1.8
            Reporter: Muthuraj Ramasamy
            Priority: Minor

Currently SubDagOperator doesn't support any xcom on its output. It would be better to specify
SubDagOperator to read the xcom of one of the task (say task "end" and can be any Operator)
and add to SubDagOperator output. Already tested the below in a local environment.

#modified to handle xcom output for the sub dag in class SubDagOperator
    def post_execute(self, context):
        ret_value = context['task_instance'].xcom_pull(dag_id=self.subdag.dag_id, task_ids='end',
key='return_value' )
        context['task_instance'].xcom_push(key='return_value', value=ret_value) 

I can make necessary changes and create a PR if this feature can be added.

This message was sent by Atlassian JIRA

View raw message