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


##########
airflow/models/abstractoperator.py:
##########
@@ -395,6 +395,18 @@ def get_closest_mapped_task_group(self) -> MappedTaskGroup 
| None:
         """
         return next(self.iter_mapped_task_groups(), None)
 
+    def get_needs_expansion(self):
+        """
+        Returns true of the task is mapped or is in a mapped task group.
+
+        :meta private:
+        """
+        if self._needs_expansion is not None:
+            return self._needs_expansion
+        if self.get_closest_mapped_task_group() is not None:
+            return True
+        return False

Review Comment:
   I don’t have a preference either way tbh. An argument-less method and a 
property are basically the same in Python anyway (aside from the call-site 
syntax). Using `cache_property` is not _technically_ out of the question since 
we need to manually populate the underlying value—we _can_ do that with a 
cached property too, it’s just very awkward. I think anyone trying to raise 
that suggestion would quickly figure that out when they try to actually change 
the implementation anyway.



-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to