tvalentyn commented on a change in pull request #14390:
URL: https://github.com/apache/beam/pull/14390#discussion_r613559177
##########
File path: sdks/python/apache_beam/pipeline.py
##########
@@ -976,6 +981,28 @@ def leave_composite_transform(self, transform_node):
pass
+class ResourceHintsPropagator(PipelineVisitor):
+ """Propagates resource hints set on composite transforms to subtransforms.
+ """
+ def visit_transform(self, transform_node):
+ # type: (AppliedPTransform) -> None
+ if (transform_node.parent is not None and
+ transform_node.parent.transform is not None and
+ transform_node.parent.transform.get_resource_hints()):
+ transform_node.transform._merge_hints_from_outer_composite(
Review comment:
Good catch re: multiple applications of the same transform, added a test.
--
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]