airflow/models/dag.py
def filter_task_group(group, parent_group):
            """Exclude tasks not included in the subdag from the given TaskGroup."""
            copied = copy.copy(group)
            copied.used_group_ids = set(copied.used_group_ids)
            copied._parent_group = parent_group

            copied.children = {}

            for child in group.children.values():
                if isinstance(child, BaseOperator):
                    if child.task_id in dag.task_dict:
                        copied.children[child.task_id] = dag.task_dict[child.task_id]
                    else:
                        copied.used_group_ids.discard(child.task_id)
                else:
                    filtered_child = filter_task_group(child, copied)

                    # Only include this child TaskGroup if it is non-empty.
                    if filtered_child.children:
                        copied.children[child.group_id] = filtered_child

            return copied
Exclude tasks not included in the subdag from the given TaskGroup.
Exclude tasks not included in the subdag from the given TaskGroup.
Exclude tasks not included in the subdag from the given TaskGroup .
def filter_task_group(group, parent_group):
            copied = copy.copy(group)
            copied.used_group_ids = set(copied.used_group_ids)
            copied._parent_group = parent_group
            copied.children = {}
            for child in group.children.values():
                if isinstance(child, BaseOperator):
                    if child.task_id in dag.task_dict:
                        copied.children[child.task_id] = dag.task_dict[child.task_id]
                    else:
                        copied.used_group_ids.discard(child.task_id)
                else:
                    filtered_child = filter_task_group(child, copied)
                    if filtered_child.children:
                        copied.children[child.group_id] = filtered_child
            return copied
def filter_task_group ( group , parent_group ) : copied = copy . copy ( group ) copied . used_group_ids = set ( copied . used_group_ids ) copied . _parent_group = parent_group copied . children = { } for child in group . children . values ( ) : if isinstance ( child , BaseOperator ) : if child . task_id in dag . task_dict : copied . children [ child . task_id ] = dag . task_dict [ child . task_id ] else : copied . used_group_ids . discard ( child . task_id ) else : filtered_child = filter_task_group ( child , copied ) if filtered_child . children : copied . children [ child . group_id ] = filtered_child return copied
Exclude tasks not included in the subdag from the given TaskGroup.
Exclude tasks not included in the subdag from the given TaskGroup .
"""Exclude tasks not included in the subdag from the given TaskGroup.""" # Only include this child TaskGroup if it is non-empty.
group
parent_group