Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 24b7bcc26 -> afa5ebc70


Fix tests unnecessarily using windowed side inputs


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/5d9506df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/5d9506df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/5d9506df

Branch: refs/heads/python-sdk
Commit: 5d9506df44e5b2cd703702d4188c25c5bbb16e7f
Parents: 552f6d7
Author: Robert Bradshaw <rober...@gmail.com>
Authored: Fri Oct 7 16:17:47 2016 -0700
Committer: Robert Bradshaw <rober...@gmail.com>
Committed: Tue Oct 18 10:48:16 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/pipeline_test.py   | 1 +
 sdks/python/apache_beam/transforms/util.py | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/5d9506df/sdks/python/apache_beam/pipeline_test.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/pipeline_test.py 
b/sdks/python/apache_beam/pipeline_test.py
index 8c1b3ba..dedd732 100644
--- a/sdks/python/apache_beam/pipeline_test.py
+++ b/sdks/python/apache_beam/pipeline_test.py
@@ -239,6 +239,7 @@ class PipelineTest(unittest.TestCase):
             'oom:combine/GroupByKey/group_by_key': 1,
             ('oom:check', None): 1,
             'assert_that/singleton': 1,
+            ('assert_that/WindowInto', None): 1,
             ('assert_that/Map(match)', None): 1,
             ('oom:combine/GroupByKey/group_by_window', None): 1,
             ('oom:combine/Combine/ParDo(CombineValuesDoFn)', None): 1})

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/5d9506df/sdks/python/apache_beam/transforms/util.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/transforms/util.py 
b/sdks/python/apache_beam/transforms/util.py
index 4564cf9..aeac0d9 100644
--- a/sdks/python/apache_beam/transforms/util.py
+++ b/sdks/python/apache_beam/transforms/util.py
@@ -21,6 +21,8 @@
 from __future__ import absolute_import
 
 from apache_beam.pvalue import AsIter as AllOf
+from apache_beam.transforms import core
+from apache_beam.transforms import window
 from apache_beam.transforms.core import CombinePerKey, Create, Flatten, 
GroupByKey, Map
 from apache_beam.transforms.ptransform import PTransform
 from apache_beam.transforms.ptransform import ptransform_fn
@@ -220,8 +222,9 @@ def assert_that(actual, matcher, label='assert_that'):
   class AssertThat(PTransform):
 
     def apply(self, pipeline):
-      return pipeline | 'singleton' >> Create([None]) | Map(match,
-                                                            AllOf(actual))
+      return pipeline | 'singleton' >> Create([None]) | Map(
+          match,
+          AllOf(actual | core.WindowInto(window.GlobalWindows())))
 
     def default_label(self):
       return label

Reply via email to