[
https://issues.apache.org/jira/browse/BEAM-8335?focusedWorklogId=350680&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-350680
]
ASF GitHub Bot logged work on BEAM-8335:
----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Nov/19 21:19
Start Date: 27/Nov/19 21:19
Worklog Time Spent: 10m
Work Description: davidyan74 commented on pull request #10236:
[BEAM-8335] Add method to PipelineInstrument to create background caching
pipline
URL: https://github.com/apache/beam/pull/10236#discussion_r351501400
##########
File path:
sdks/python/apache_beam/runners/interactive/pipeline_instrument_test.py
##########
@@ -178,14 +184,47 @@ def test_has_unbounded_source(self):
p = beam.Pipeline(interactive_runner.InteractiveRunner())
_ = p | 'ReadUnboundedSource' >> beam.io.ReadFromPubSub(
subscription='projects/fake-project/subscriptions/fake_sub')
- self.assertTrue(instr.has_unbounded_source(p))
+ self.assertTrue(instr.has_unbounded_sources(p))
def test_not_has_unbounded_source(self):
p = beam.Pipeline(interactive_runner.InteractiveRunner())
with tempfile.NamedTemporaryFile(delete=False) as f:
f.write(b'test')
_ = p | 'ReadBoundedSource' >> beam.io.ReadFromText(f.name)
- self.assertFalse(instr.has_unbounded_source(p))
+ self.assertFalse(instr.has_unbounded_sources(p))
+
+ def test_background_caching_pipeline_proto(self):
+ p = beam.Pipeline(interactive_runner.InteractiveRunner())
+
+ # Test that the two ReadFromPubSub are correctly cut out.
+ a = p | 'ReadUnboundedSourceA' >> beam.io.ReadFromPubSub(
+ subscription='projects/fake-project/subscriptions/fake_sub')
+ b = p | 'ReadUnboundedSourceB' >> beam.io.ReadFromPubSub(
+ subscription='projects/fake-project/subscriptions/fake_sub')
+
+ # Add some extra PTransform afterwards to make sure that only the unbounded
+ # sources remain.
+ c = (a, b) | beam.CoGroupByKey()
+ d = c | beam.Map(lambda x: x)
+
+ instrumenter = instr.PipelineInstrument(p)
+ actual_pipeline = instrumenter.background_caching_pipeline_proto()
Review comment:
Can we also add a test that verifies the user pipeline now contains a
TestStream that outputs two pcollections that is consumed by the CoGroupByKey
and then the Map?
----------------------------------------------------------------
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: 350680)
Time Spent: 35h 50m (was: 35h 40m)
> Add streaming support to Interactive Beam
> -----------------------------------------
>
> Key: BEAM-8335
> URL: https://issues.apache.org/jira/browse/BEAM-8335
> Project: Beam
> Issue Type: Improvement
> Components: runner-py-interactive
> Reporter: Sam Rohde
> Assignee: Sam Rohde
> Priority: Major
> Time Spent: 35h 50m
> Remaining Estimate: 0h
>
> This issue tracks the work items to introduce streaming support to the
> Interactive Beam experience. This will allow users to:
> * Write and run a streaming job in IPython
> * Automatically cache records from unbounded sources
> * Add a replay experience that replays all cached records to simulate the
> original pipeline execution
> * Add controls to play/pause/stop/step individual elements from the cached
> records
> * Add ability to inspect/visualize unbounded PCollections
--
This message was sent by Atlassian Jira
(v8.3.4#803005)