jscheffl commented on code in PR #53431:
URL: https://github.com/apache/airflow/pull/53431#discussion_r2211192077
##########
providers/standard/src/airflow/providers/standard/operators/branch.py:
##########
@@ -56,9 +56,7 @@ def _expand_task_group_roots(
if TYPE_CHECKING:
assert dag
- if branches_to_execute is None:
- return
- elif isinstance(branches_to_execute, str) or not
isinstance(branches_to_execute, Iterable):
+ if isinstance(branches_to_execute, str) or not
isinstance(branches_to_execute, Iterable):
Review Comment:
Checked all signatures and in no case it is today used w/o providing
branches. From typing it requests to provide a str or Interable. So if user
does not provide branches then it is against documented interfaces.
I am only 90% sure as on one side the public interface is documented as this
but there is no sanity check otherwise and it might be users are using the
MixIn against the interface spec. So this is the "clean" way but if we assume
"in the wild" it is also used not according to the interface in user
code/inherited operators then the alternative would be to widen the interface
to also explicitly allow `None`. (I would not keep it as is, because this check
is not needed according to documented interface)
--
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]