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

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

                Author: ASF GitHub Bot
            Created on: 10/Sep/20 18:55
            Start Date: 10/Sep/20 18:55
    Worklog Time Spent: 10m 
      Work Description: rohdesamuel commented on a change in pull request 
#12704:
URL: https://github.com/apache/beam/pull/12704#discussion_r486566349



##########
File path: sdks/python/apache_beam/runners/interactive/interactive_beam.py
##########
@@ -273,6 +270,10 @@ def show(*pcolls, **configs):
   The given pcolls can be dictionary of PCollections (as values), or iterable
   of PCollections or plain PCollection values.
 
+  The user can specify either the max number of elements with `n` to read
+  or the maximum duration of elements to read with `duration`. When a limiter 
is
+  not supplied, it is assumed to be infinite.
+
   There are 2 boolean configurations:

Review comment:
       Done, added some arg doc strings.

##########
File path: sdks/python/apache_beam/runners/interactive/interactive_beam.py
##########
@@ -342,121 +343,79 @@ def show(*pcolls, **configs):
     assert isinstance(pcoll, beam.pvalue.PCollection), (
         '{} is not an apache_beam.pvalue.PCollection.'.format(pcoll))
   user_pipeline = pcolls[0].pipeline
-  for pcoll in pcolls:
-    assert pcoll.pipeline is user_pipeline, (
-        '{} belongs to a different user-defined pipeline ({}) than that of'
-        ' other PCollections ({}).'.format(
-            pcoll, pcoll.pipeline, user_pipeline))
+
   # TODO(BEAM-8288): Remove below pops and assertion once Python 2 is
   # deprecated from Beam.
   include_window_info = configs.pop('include_window_info', False)
   visualize_data = configs.pop('visualize_data', False)
+  n = configs.pop('n', 'inf')
+  duration = configs.pop('duration', 'inf')
+
+  if n == 'inf':
+    n = float('inf')
+
+  if duration == 'inf':
+    duration = float('inf')
+
   # This assertion is to protect the backward compatibility for function
   # signature change after Python 2 deprecation.
   assert not configs, (
       'The only configs supported are include_window_info and '
       'visualize_data.')

Review comment:
       Done




----------------------------------------------------------------
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: 481650)
    Time Spent: 28.5h  (was: 28h 20m)

> 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: 28.5h
>  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