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 2022/01/18 04:21:37 UTC

[GitHub] [airflow] uranusjr commented on issue #16764: TaskGroup dependencies handled inconsistently

uranusjr commented on issue #16764:
URL: https://github.com/apache/airflow/issues/16764#issuecomment-1015058864


   One way I can think of to get rid of all the complexity is to _prohibit_ the task group from being used before the context manager exits, i.e.
   
   ```python
   with TaskGroup('tg') as taskgroup:
       task1 = ...
       task2 = ...
       task1 >> task2  # Fine.
       start >> taskgroup >> end  # Throws error!
   ```
   
   ```python
   with TaskGroup('tg') as taskgroup:
       task1 = ...
       task2 = ...
       task1 >> task2
   start >> taskgroup >> end  # Must do this instead.
   ```
   
   This essentially ensures the step 3 happens after step 2, and leaves only steps 3 and 4 to be interchangable. Does
   
   ```python
   with TaskGroup('tg') as taskgroup:
       task1 = ...
       task2 = ...
   start >> taskgroup >> end
   task1 >> task2
   ```
   
   produce an “expected” graph? If it does, all problems would be solved from what I can tell; if not, this is the only thing we need to fix (aside from implementing logic to prohibit a task gorup to be used before exiting).
   
   This would break some of the existing usages, but I _think_ we might be able to get away with the breaking change because most of the usages that would break does not work very well right now anyway (as shown in this issue), and therefore are unlikely to be widely in use right now.


-- 
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