You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "liferoad (via GitHub)" <gi...@apache.org> on 2023/07/10 17:15:56 UTC

[GitHub] [beam] liferoad commented on a diff in pull request #27373: [Python] use get_buffer to fetch buffer when the buffer is None

liferoad commented on code in PR #27373:
URL: https://github.com/apache/beam/pull/27373#discussion_r1258616837


##########
sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py:
##########
@@ -840,6 +841,12 @@ def _execute_bundle(self,
           # so we create a copy of the buffer for every new stage.
           runner_execution_context.pcoll_buffers[buffer_id] = buffer.copy()
           buffer = runner_execution_context.pcoll_buffers[buffer_id]
+        # When the buffer is not in the pcoll_buffers, it means that the
+        # it could be an empty PCollection. In this case, get the buffer using
+        # the buffer id and transform id
+        if buffer is None:
+          buffer = bundle_context_manager.get_buffer(buffer_id, transform_id)
+          assert buffer is not None

Review Comment:
   can we log this with a clear error message?



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org