tvalentyn commented on a change in pull request #13303:
URL: https://github.com/apache/beam/pull/13303#discussion_r523250343
##########
File path:
sdks/python/apache_beam/runners/portability/fn_api_runner/translations.py
##########
@@ -1212,6 +1213,22 @@ def get_ancestors(name):
return None
+def _parent_for_fused_stages(stages, context):
+ # type: (Iterable[str], TransformContext) -> Optional[str]
+
+ '''Returns the name of the new parent for the fused stages.
+
+ The new parent is the lowest common ancestor of the fused stages that is not
+ contained in the set of fused stages. The provided context is used to compute
+ ancestors of stages.
+ '''
+ result = functools.reduce(
+ lambda a, b: _lowest_common_ancestor(a, b, context), stages)
+ if result in stages:
+ result = context.parents_map().get(result)
Review comment:
q.e.d. Thanks :)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]