uranusjr commented on code in PR #38883:
URL: https://github.com/apache/airflow/pull/38883#discussion_r1580468363
##########
airflow/operators/branch.py:
##########
@@ -34,8 +36,42 @@ class BranchMixIn(SkipMixin):
def do_branch(self, context: Context, branches_to_execute: str |
Iterable[str]) -> str | Iterable[str]:
"""Implement the handling of branching including logging."""
self.log.info("Branch into %s", branches_to_execute)
- self.skip_all_except(context["ti"], branches_to_execute)
- return branches_to_execute
+ branch_task_ids = self.expand_task_group_roots(context["ti"],
branches_to_execute)
+ self.skip_all_except(context["ti"], branch_task_ids)
+ return branch_task_ids
+
+ def expand_task_group_roots(
+ self, ti: TaskInstance | TaskInstancePydantic, branches_to_execute:
str | Iterable[str]
+ ) -> str | Iterable[str]:
Review Comment:
It appears to “work fine” because the generator quietly yields nothing after
it is exhausted, and the line becomes a no-op.
--
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]