pabloem commented on a change in pull request #10994: [BEAM-8335] 
TeststreamService integration with DirectRunner
URL: https://github.com/apache/beam/pull/10994#discussion_r387976936
 
 

 ##########
 File path: sdks/python/apache_beam/runners/direct/test_stream_impl.py
 ##########
 @@ -226,17 +237,53 @@ def expand(self, pcoll):
   def _infer_output_coder(self, input_type=None, input_coder=None):
     return self.coder
 
-  def _events_from_script(self, index):
-    yield self._events[index]
-
-  def events(self, index):
-    return self._events_from_script(index)
-
-  def begin(self):
-    return 0
-
-  def end(self, index):
-    return index >= len(self._events)
+  @staticmethod
+  def events_from_script(events):
+    """Yields the in-memory events.
+    """
+    return itertools.chain(events)
 
 Review comment:
   Let's add an assert to make sure that this is only called when we have 
in-memory events vs rpc events (also in the method below).

----------------------------------------------------------------
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

Reply via email to