[ 
https://issues.apache.org/jira/browse/BEAM-10603?focusedWorklogId=467545&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-467545
 ]

ASF GitHub Bot logged work on BEAM-10603:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Aug/20 20:13
            Start Date: 06/Aug/20 20:13
    Worklog Time Spent: 10m 
      Work Description: davidyan74 commented on a change in pull request #12413:
URL: https://github.com/apache/beam/pull/12413#discussion_r466657201



##########
File path: sdks/python/apache_beam/runners/interactive/utils.py
##########
@@ -27,30 +27,46 @@
 import pandas as pd
 
 from apache_beam.portability.api.beam_runner_api_pb2 import TestStreamPayload
+from apache_beam.testing.test_stream import WindowedValueHolder
 
 
 def to_element_list(
     reader,  # type: Generator[Union[TestStreamPayload.Event, 
WindowedValueHolder]]
     coder,  # type: Coder
-    include_window_info  # type: bool
+    include_window_info,  # type: bool
+    n=None  # type: int
 ):
   # type: (...) -> List[WindowedValue]
 
   """Returns an iterator that properly decodes the elements from the reader.
   """
 
-  for e in reader:
-    if isinstance(e, TestStreamPayload.Event):
-      if (e.HasField('watermark_event') or 
e.HasField('processing_time_event')):
-        continue
+  # Defining a generator like this makes it easier to limit the count of
+  # elements read. Otherwise, the count limit would need to be duplicated.
+  def elements():
+    for e in reader:
+      if isinstance(e, TestStreamPayload.Event):
+        if (e.HasField('watermark_event') or
+            e.HasField('processing_time_event')):
+          continue
+        else:

Review comment:
       nit: this else is not necessary since the flow ends with continue.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 467545)
    Time Spent: 2h 40m  (was: 2.5h)

> Large Source Recording for Interarctive Runner
> ----------------------------------------------
>
>                 Key: BEAM-10603
>                 URL: https://issues.apache.org/jira/browse/BEAM-10603
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-py-interactive
>            Reporter: Sam Rohde
>            Assignee: Sam Rohde
>            Priority: P1
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> This changes the Interactive Runner to create a long-running background 
> caching job that is decoupled from the user pipeline. When a user invokes a 
> collect() or show(), it will read from the cache to compute the requested 
> PCollections. Previously, the user would have to wait for the cache to be 
> fully written to. This allows for the user to start experimenting immediately.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to