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


##########
airflow/models/taskmixin.py:
##########
@@ -115,24 +117,39 @@ def __rlshift__(self, other: DependencyMixin | 
Sequence[DependencyMixin]):
         self.__rshift__(other)
         return self
 
+    @abstractmethod
+    def add_to_taskgroup(self, task_group: TaskGroup) -> None:
+        """Add the task to the given task group."""
+        raise NotImplementedError()
+
+    @staticmethod
+    def _iter_references(obj: Any) -> Iterable[DependencyMixin]:
+        from airflow.models.baseoperator import AbstractOperator
+        from airflow.models.xcom_arg import PlainXComArg
+
+        if isinstance(obj, AbstractOperator):
+            yield obj
+        elif isinstance(obj, PlainXComArg):
+            yield obj.operator
+        elif isinstance(obj, Sequence):
+            for o in obj:
+                yield from DependencyMixin._iter_references(o)

Review Comment:
   ```suggestion
                   yield from cls._iter_references(o)
   ```
   
   if you change the decorator to `classmethod`



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