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


##########
airflow/models/abstractoperator.py:
##########
@@ -284,13 +282,22 @@ def iter_mapped_dependants(self) -> 
Iterator[MappedOperator]:
         )
 
     def iter_mapped_task_groups(self) -> Iterator[MappedTaskGroup]:
-        """Return mapped task groups this task belongs to."""
+        """Return mapped task groups this task belongs to.
+
+        Groups are returned from the closest to the outmost.
+
+        :meta private:
+        """
         parent = self.task_group
         while parent is not None:
             if isinstance(parent, MappedTaskGroup):
                 yield parent
             parent = parent.task_group
 
+    def get_closest_mapped_task_group(self) -> MappedTaskGroup | None:

Review Comment:
   Closest ancestor (parent). Since this is an operator, it cannot have a 
child, so I think it’s reasonable to omit _parent_ in the name? Also there’s 
already `self.task_group`, which refers to the parent 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to