ephraimbuddy commented on code in PR #32351:
URL: https://github.com/apache/airflow/pull/32351#discussion_r1253009131
##########
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:
Since `other` could also be a classic operator or a list of it, I don't
think reusing `XComArg.iter_xcom_references()` will work here?
--
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]