[
https://issues.apache.org/jira/browse/BEAM-8335?focusedWorklogId=342897&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-342897
]
ASF GitHub Bot logged work on BEAM-8335:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Nov/19 21:15
Start Date: 13/Nov/19 21:15
Worklog Time Spent: 10m
Work Description: rohdesamuel commented on pull request #9953:
[BEAM-8335] Adds support for multi-output TestStream
URL: https://github.com/apache/beam/pull/9953#discussion_r346004998
##########
File path: sdks/python/apache_beam/testing/test_stream_test.py
##########
@@ -125,6 +125,98 @@ def process(self, element=beam.DoFn.ElementParam,
p.run()
+ def test_multiple_outputs(self):
+ """Tests that the TestStream supports emitting to multiple PCollections."""
+ test_stream = (TestStream()
+ .advance_watermark_to(5, tag='letters')
+ .add_elements(['a', 'b', 'c'], tag='letters')
+ .advance_watermark_to(10, tag='numbers')
+ .add_elements(['1', '2', '3'], tag='numbers'))
+
+ class RecordFn(beam.DoFn):
+ def process(self, element=beam.DoFn.ElementParam,
+ timestamp=beam.DoFn.TimestampParam):
+ yield (element, timestamp)
+
+ options = StandardOptions(streaming=True)
+ p = TestPipeline(options=options)
+
+ main = p | test_stream
+ letters = main['letters'] | 'record letters' >> beam.ParDo(RecordFn())
+ numbers = main['numbers'] | 'record numbers' >> beam.ParDo(RecordFn())
+
+ assert_that(letters, equal_to([
+ ('a', Timestamp(5)),
+ ('b', Timestamp(5)),
+ ('c', Timestamp(5))]), label='assert letters')
+
+ assert_that(numbers, equal_to([
+ ('1', Timestamp(10)),
+ ('2', Timestamp(10)),
+ ('3', Timestamp(10))]), label='assert numbers')
+
+ p.run()
+
+ def test_multiple_outputs_with_watermark_advancement(self):
+ """Tests that the TestStream can independently output watermarks."""
+
+ # Purposely set the watmerk of numbers to 20 then letters to 5 to test
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: 342897)
Time Spent: 25h (was: 24h 50m)
> 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: 25h
> 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)