boraberke commented on code in PR #38883:
URL: https://github.com/apache/airflow/pull/38883#discussion_r1580019503
##########
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:
Not sure if I need to change that, `skip_all_except` already accepts passing
in an iterator and with the latest commit with generator, it looks like it
works fine. What do you think?
--
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]