robertwb commented on a change in pull request #11185: [BEAM-8019] Some
generalizations to support cross-language transforms.
URL: https://github.com/apache/beam/pull/11185#discussion_r397543820
##########
File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner.py
##########
@@ -380,7 +381,12 @@ def visit_transform(self, transform_node):
# pylint: disable=wrong-import-order, wrong-import-position
from apache_beam import Flatten
if isinstance(transform_node.transform, Flatten):
- output_pcoll = transform_node.outputs[None]
+ from apache_beam.runners.portability.fn_api_runner.translations \
+ import only_element
+ output_pcoll = (
+ transform_node.outputs[None] if None in transform_node.outputs
+ else only_element(transform_node.outputs.values()))
Review comment:
`only_element` is fine to use everywhere, no need to branch on the key being
None.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services