uranusjr commented on code in PR #32099:
URL: https://github.com/apache/airflow/pull/32099#discussion_r1244643880
##########
airflow/models/taskmixin.py:
##########
@@ -112,6 +115,31 @@ def __rlshift__(self, other: DependencyMixin |
Sequence[DependencyMixin]):
self.__rshift__(other)
return self
+ def set_setup_teardown_ctx_dependencies(self, other: DependencyMixin |
Sequence[DependencyMixin]):
+ if not SetupTeardownContext.active:
+ return
+ from airflow.models.xcom_arg import PlainXComArg
+
+ op1 = self
+ if isinstance(self, PlainXComArg):
+ op1 = self.operator
+ if getattr(op1, "is_setup") or getattr(op1, "is_teardown"):
+ return
+ SetupTeardownContext.update_context_map(op1)
Review Comment:
We should add annotations to `update_context_map` and the various things
that function references as well. I have a feeling this is also not handled
well inside there—the argument name is `operator` but there are obviously cases
where `op1` and `other` is not an operator in this function.
--
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]