damccorm commented on code in PR #36251:
URL: https://github.com/apache/beam/pull/36251#discussion_r2380200051


##########
sdks/python/apache_beam/pipeline.py:
##########
@@ -354,7 +354,7 @@ def _replace_if_needed(self, original_transform_node):
           if replacement_transform is original_transform_node.transform:
             return
           replacement_transform.side_inputs = tuple(
-              original_transform_node.transform.side_inputs)
+              getattr(original_transform_node.transform, 'side_inputs', ()))

Review Comment:
   So would updating 
https://github.com/apache/beam/blob/0432c225c2d74bb35af952507f34877392f2773c/sdks/python/apache_beam/transforms/ptransform.py#L359
   
   The reason https://github.com/apache/beam/pull/36184/files#r2359516983 was 
breaking is because:
   
   1) There were transforms which didn't have explicit labels
   2) Those transforms get autoassigned names which include the line number. 
For example `Map(<lambda at bigquery_file_loads.py:1157>)` in 
https://github.com/apache/beam/pull/34807/files
   3) When we change the file, the line number that those transforms land on is 
no longer the same
   
   So if we:
   
   1) Explicitly name the transform which is getting assigned a name with a 
line number
   2) Add these properties to 
https://github.com/apache/beam/blob/0432c225c2d74bb35af952507f34877392f2773c/sdks/python/apache_beam/transforms/ptransform.py#L359
   
   Then we should fix this issue while avoiding any breaking changes.



-- 
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]

Reply via email to