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


##########
airflow/models/taskmixin.py:
##########
@@ -140,6 +142,27 @@ def set_setup_teardown_ctx_dependencies(self, other: 
DependencyMixin | Sequence[
             return
         SetupTeardownContext.update_context_map(other)
 
+    def set_taskgroup_ctx_dependencies(self, other: DependencyMixin | 
Sequence[DependencyMixin]):
+        from airflow.utils.task_group import TaskGroupContext
+
+        if not TaskGroupContext.active:
+            return
+        from airflow.models.xcom_arg import PlainXComArg
+
+        op1 = self
+        if isinstance(self, PlainXComArg):
+            op1 = self.operator
+        TaskGroupContext.add_task(op1)
+        if isinstance(other, Sequence):
+            for op in other:

Review Comment:
   I added a method in DependencyMixin instead of a refactor to 
`iter_xom_references`. Using `iter_xcom_references` I had issues where we 
checked if it was an instance of `AbstractOperator` and iterated through the 
template fields. Instead of refactoring it, I opted to add another method on 
DependencyMixn to just return operator



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