ashb commented on a change in pull request #19965:
URL: https://github.com/apache/airflow/pull/19965#discussion_r771576601
##########
File path: airflow/utils/task_group.py
##########
@@ -348,10 +382,35 @@ def build_map(task_group):
build_map(self)
return task_group_map
- def get_child_by_label(self, label: str) -> Union["BaseOperator",
"TaskGroup"]:
+ def get_child_by_label(self, label: str) -> DAGNode:
"""Get a child task/TaskGroup by its label (i.e. task_id/group_id
without the group_id prefix)"""
return self.children[self.child_id(label)]
+ def map(self, arg: Iterable) -> "MappedTaskGroup":
+ if self.children:
+ raise RuntimeError("Cannot map a TaskGroup that already has
children")
+ if not self.group_id:
+ raise RuntimeError("Cannot map a TaskGroup before it has a
group_id")
+ if self._parent_group:
+ self._parent_group._remove(self)
+ tg = MappedTaskGroup(self._group_id)
+ tg.mapped_arg = arg
+ tg.mapped_kwargs = {}
+ tg.partial_kwargs = {}
Review comment:
Nope, no idea why they weren't - just fixed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]