You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/02 01:01:33 UTC

[GitHub] [beam] robertwb commented on a change in pull request #11283: [BEAM-9322] [BEAM-1833] Better naming for composite transform output tags.

robertwb commented on a change in pull request #11283: [BEAM-9322] [BEAM-1833] Better naming for composite transform output tags.
URL: https://github.com/apache/beam/pull/11283#discussion_r401995268
 
 

 ##########
 File path: sdks/python/apache_beam/pipeline.py
 ##########
 @@ -671,7 +671,11 @@ def apply(
         # If the user wants the old implementation of always generated
         # PCollection output ids, then set the tag to None first, then count up
         # from 1.
-        tag = len(current.outputs) if None in current.outputs else None
+        base = tag
+        counter = 0
+        while tag in current.outputs:
+          counter += 1
+          tag = '%s_%d' % (base, counter)
         current.add_output(result, tag)
 
 Review comment:
   I am relatively confident in this change, as it preserves the essential characteristic (that output names are unique) and defaults to the same thing for all single-output transforms. However, I have added the opt-out you had originally with a note just in case. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services