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

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

                Author: ASF GitHub Bot
            Created on: 16/Sep/20 22:42
            Start Date: 16/Sep/20 22:42
    Worklog Time Spent: 10m 
      Work Description: rohdesamuel commented on a change in pull request 
#12799:
URL: https://github.com/apache/beam/pull/12799#discussion_r489793686



##########
File path: sdks/python/apache_beam/runners/interactive/recording_manager_test.py
##########
@@ -149,43 +152,37 @@ def test_read_n(self):
 
   def test_read_duration(self):
     """Test that the stream only reads a 'duration' of elements."""
+    def as_windowed_value(element):
+      return WindowedValueHolder(WindowedValue(element, 0, []))
 
     values = (FileRecordsBuilder(tag=self.cache_key)
               .advance_processing_time(1)
-              .add_element(element=0, event_time_secs=0)
+              .add_element(element=as_windowed_value(0), event_time_secs=0)
               .advance_processing_time(1)
-              .add_element(element=1, event_time_secs=1)
+              .add_element(element=as_windowed_value(1), event_time_secs=1)
               .advance_processing_time(1)
-              .add_element(element=2, event_time_secs=3)
+              .add_element(element=as_windowed_value(2), event_time_secs=3)
               .advance_processing_time(1)
-              .add_element(element=3, event_time_secs=4)
+              .add_element(element=as_windowed_value(3), event_time_secs=4)
               .advance_processing_time(1)
-              .add_element(element=4, event_time_secs=5)
+              .add_element(element=as_windowed_value(4), event_time_secs=5)
               .build()) # yapf: disable
 
+    values = [
+        v.recorded_event for v in values if isinstance(v, TestStreamFileRecord)
+    ]
+
     self.mock_result.set_state(PipelineState.DONE)
     self.cache.write(values, 'full', self.cache_key)
-    self.cache.save_pcoder(None, 'full', self.cache_key)
-
-    # The elements read from the cache are TestStreamFileRecord instances and
-    # have the underlying elements encoded. This method decodes the elements
-    # from the TestStreamFileRecord.
-    def get_elements(events):
-      coder = coders.FastPrimitivesCoder()
-      elements = []
-      for e in events:
-        if not isinstance(e, TestStreamFileRecord):
-          continue
-
-        if e.recorded_event.element_event:
-          elements += ([
-              coder.decode(el.encoded_element)
-              for el in e.recorded_event.element_event.elements
-          ])
-      return elements
+    self.cache.save_pcoder(coders.FastPrimitivesCoder(), 'full', 
self.cache_key)
 
     # The following tests a progression of reading different durations from the
     # cache.
+
+    # Small convienence function for getting the values.
+    def get_elements(events):
+      return [e.value for e in events]

Review comment:
       The test uses the `InMemoryCache` set in the `setUp` method that 
directly writes values to an in-memory map verbatim.




----------------------------------------------------------------
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: 485444)
    Time Spent: 31h 40m  (was: 31.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: 31h 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