uranusjr commented on code in PR #33732: URL: https://github.com/apache/airflow/pull/33732#discussion_r1308938544
########## airflow/decorators/task_group.py: ########## @@ -132,11 +132,14 @@ def expand(self, **kwargs: OperatorExpandArgument) -> DAGNode: self._validate_arg_names("expand", kwargs) prevent_duplicates(self.partial_kwargs, kwargs, fail_reason="mapping already partial") expand_input = DictOfListsExpandInput(kwargs) - return self._create_task_group( + new_task_group = self._create_task_group( functools.partial(MappedTaskGroup, expand_input=expand_input), **self.partial_kwargs, **{k: MappedArgument(input=expand_input, key=k) for k in kwargs}, ) + for op, _ in expand_input.iter_references(): + new_task_group.set_upstream(op) Review Comment: This logic should be in `_create_task_group` instead. The function is also called in `__call__` and this change is breaking the non-expanding use cases. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org