Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sdks/python/apache_beam/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,9 +843,10 @@ def apply(

assert isinstance(result.producer.inputs, tuple)
if isinstance(result, pvalue.DoOutputsTuple):
for tag, pc in list(result._pcolls.items()):
all_tags = [result._main_tag] + list(result._tags)
for tag in all_tags:
if tag not in current.outputs:
current.add_output(pc, tag)
current.add_output(result[tag], tag)
continue

# If there is already a tag with the same name, increase a counter for
Expand Down
7 changes: 4 additions & 3 deletions sdks/python/apache_beam/pipeline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1646,9 +1646,10 @@ def expand(self, pcoll):
all_applied_transforms[xform.full_label] = xform
current_transforms.extend(xform.parts)
xform = all_applied_transforms['Split Sales']
# Confirm that Split Sales correctly has two outputs as specified by
# ParDo.with_outputs in ParentSalesSplitter.
assert len(xform.outputs) == 2
# Confirm that Split Sales correctly has three outputs: the main
# (untagged) output plus the two tagged outputs specified by
# ParDo.with_outputs in ParentSalesSplitter.
assert len(xform.outputs) == 3


if __name__ == '__main__':
Expand Down
Loading