[BEAM-12326] Preserve resource hints across transform substitution.
diff --git a/sdks/python/apache_beam/pipeline.py b/sdks/python/apache_beam/pipeline.py
index e296a30..35d38a7 100644
--- a/sdks/python/apache_beam/pipeline.py
+++ b/sdks/python/apache_beam/pipeline.py
@@ -299,6 +299,9 @@
               original_transform_node.full_label,
               original_transform_node.inputs)
 
+          replacement_transform_node.resource_hints = (
+              original_transform_node.resource_hints)
+
           # Transform execution could depend on order in which nodes are
           # considered. Hence we insert the replacement transform node to same
           # index as the original transform node. Note that this operation