Skip to content

Commit

Permalink
[BEAM-8575] Refactor test_do_fn_with_windowing_in_finish_bundle to wo…
Browse files Browse the repository at this point in the history
…rk with Dataflow runner (apache#10447)

* [BEAM-8575] Refactor test_do_fn_with_windowing_in_finish_bundle to work with Dataflow runner

* Update sdks/python/apache_beam/transforms/ptransform_test.py

Co-Authored-By: Yichi Zhang <[email protected]>

Co-authored-by: Yichi Zhang <[email protected]>
  • Loading branch information
2 people authored and angoenka committed Jan 4, 2020
1 parent 952c608 commit e2bb239
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdks/python/apache_beam/transforms/ptransform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ def finish_bundle(self):

pipeline = TestPipeline()
result = (pipeline
| 'Start' >> beam.Create([x for x in range(3)])
| 'Start' >> beam.Create([1])
| beam.ParDo(MyDoFn())
| WindowInto(windowfn)
| 'create tuple' >> beam.Map(
lambda v, t=beam.DoFn.TimestampParam, w=beam.DoFn.WindowParam:
(v, t, w.start, w.end)))
expected_process = [('process'+ str(x), Timestamp(5), Timestamp(4),
Timestamp(6)) for x in range(3)]
expected_process = [('process1', Timestamp(5), Timestamp(4),
Timestamp(6))]
expected_finish = [('finish', Timestamp(1), Timestamp(0), Timestamp(2))]

assert_that(result, equal_to(expected_process + expected_finish))
Expand Down

0 comments on commit e2bb239

Please sign in to comment.