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/09/24 22:49:57 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #26658: Clear TaskGroup

uranusjr commented on code in PR #26658:
URL: https://github.com/apache/airflow/pull/26658#discussion_r979326927


##########
airflow/utils/task_group.py:
##########
@@ -453,6 +454,21 @@ def topological_sort(self, _include_subdag_tasks: bool = False):
 
         return graph_sorted
 
+    def get_task_dict(self) -> dict[str, AbstractOperator]:
+        """Returns a flat dictionary of task_id: AbstractOperator"""
+        task_map = {}
+
+        def build_map(dag_node):
+            if not isinstance(dag_node, TaskGroup):

Review Comment:
   You want to flip this check, checking something is a task (AbstractOperator) instead of not a task group



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