Skip to content

Commit 084c4da

Browse files
authored
Revert "fix(python): Register all output pcollections of a transform rather t…" (#37801)
This reverts commit 6a1618e.
1 parent eccfdbc commit 084c4da

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

sdks/python/apache_beam/pipeline.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -829,10 +829,9 @@ def _apply_internal(
829829

830830
assert isinstance(result.producer.inputs, tuple)
831831
if isinstance(result, pvalue.DoOutputsTuple):
832-
all_tags = [result._main_tag] + list(result._tags)
833-
for tag in all_tags:
832+
for tag, pc in list(result._pcolls.items()):
834833
if tag not in current.outputs:
835-
current.add_output(result[tag], tag)
834+
current.add_output(pc, tag)
836835
continue
837836

838837
# If there is already a tag with the same name, increase a counter for

sdks/python/apache_beam/pipeline_test.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,10 +1648,9 @@ def expand(self, pcoll):
16481648
all_applied_transforms[xform.full_label] = xform
16491649
current_transforms.extend(xform.parts)
16501650
xform = all_applied_transforms['Split Sales']
1651-
# Confirm that Split Sales correctly has three outputs: the main
1652-
# (untagged) output plus the two tagged outputs specified by
1653-
# ParDo.with_outputs in ParentSalesSplitter.
1654-
assert len(xform.outputs) == 3
1651+
# Confirm that Split Sales correctly has two outputs as specified by
1652+
# ParDo.with_outputs in ParentSalesSplitter.
1653+
assert len(xform.outputs) == 2
16551654

16561655

16571656
if __name__ == '__main__':

0 commit comments

Comments
 (0)