You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/10/01 00:54:47 UTC

[GitHub] [airflow] alex-astronomer edited a comment on issue #17686: Xcomms with Taskflow API cause unwanted dependencies in UI

alex-astronomer edited a comment on issue #17686:
URL: https://github.com/apache/airflow/issues/17686#issuecomment-931800470


   I'm still inclined to call this a bug @ephraimbuddy.  Here's why.  I believe that all of the methods to define this should have the same behavior.
   
   ```
   date = set_date()
   task2 = xcomm_task2(date)
   task3 = xcomm_task3(date)
   date >> task2 >> task3
   ```
   
   should output the same DAG as 
   
   ```
   @dag(default_args=default_args,
         schedule_interval=None,
           start_date=datetime(2021, 8, 1),
          dagrun_timeout=timedelta(hours=4),
          max_active_runs=1)
   def xcomm_taskflow_dag():
       @task()
       def set_date():
           date ="1-2-21"
           return date
       @task()
       def xcomm_task2(**kwargs):
           date=kwargs['ti'].xcom_pull(task_ids="set_date")
           print(f"xcomm_task2:{date}")
   
       @task()
       def xcomm_task3(**kwargs):
           date=kwargs['ti'].xcom_pull(task_ids="set_date")
           print(f"xcomm_task3:{date}")
       
       set_date() >> xcomm_task2() >> xcomm_task3()
   ```
   which should output the same DAG as 
   ```
   @dag(default_args=default_args,
         schedule_interval=None,
           start_date=datetime(2021, 8, 1),
          dagrun_timeout=timedelta(hours=4),
          max_active_runs=1)
   def xcomm_taskflow_dag():
       @task()
       def set_date():
           date ="1-2-21"
           return date
       @task()
       def xcomm_task2(date):
           print(f"xcomm_task2:{date}")
   
       @task()
       def xcomm_task3(**kwargs):
           date=kwargs['ti'].xcom_pull(task_ids="set_date")
           print(f"xcomm_task3:{date}")
       
       xcomm_task2(set_date()) >> xcomm_task3()
   ```
   
   I'm going to keep digging into this and see what differences there are between the 3 methods.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org