You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by bc...@apache.org on 2016/06/21 22:41:00 UTC
[1/2] incubator-beam git commit: Use item equality in apply_to_list
test
Repository: incubator-beam
Updated Branches:
refs/heads/python-sdk f166b16b8 -> 4840f5275
Use item equality in apply_to_list test
Orders of PCollections are not guaranteed and this test depends on
the current DirectRunner implementation for output to have the same
order as input.
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/0608ad94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/0608ad94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/0608ad94
Branch: refs/heads/python-sdk
Commit: 0608ad94758afe8caebb5f1d8472f89718668542
Parents: f166b16
Author: Ahmet Altay <al...@google.com>
Authored: Tue Jun 21 11:05:39 2016 -0700
Committer: Ahmet Altay <al...@google.com>
Committed: Tue Jun 21 11:05:39 2016 -0700
----------------------------------------------------------------------
sdks/python/apache_beam/transforms/ptransform_test.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0608ad94/sdks/python/apache_beam/transforms/ptransform_test.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/transforms/ptransform_test.py b/sdks/python/apache_beam/transforms/ptransform_test.py
index 401bcb4..3244473 100644
--- a/sdks/python/apache_beam/transforms/ptransform_test.py
+++ b/sdks/python/apache_beam/transforms/ptransform_test.py
@@ -510,14 +510,15 @@ class PTransformTest(unittest.TestCase):
pipeline.run()
def test_apply_to_list(self):
- self.assertEqual([1, 2, 3], [0, 1, 2] | beam.Map('add_one', lambda x: x + 1))
- self.assertEqual([1], [0, 1, 2] | beam.Filter('odd', lambda x: x % 2))
- self.assertEqual([1, 2, 3, 100],
- ([1, 2, 3], [100]) | beam.Flatten('flat'))
+ self.assertItemsEqual(
+ [1, 2, 3], [0, 1, 2] | beam.Map('add_one', lambda x: x + 1))
+ self.assertItemsEqual([1], [0, 1, 2] | beam.Filter('odd', lambda x: x % 2))
+ self.assertItemsEqual([1, 2, 100, 3],
+ ([1, 2, 3], [100]) | beam.Flatten('flat'))
join_input = ([('k', 'a')],
[('k', 'b'), ('k', 'c')])
- self.assertEqual([('k', (['a'], ['b', 'c']))],
- join_input | beam.CoGroupByKey('join'))
+ self.assertItemsEqual([('k', (['a'], ['b', 'c']))],
+ join_input | beam.CoGroupByKey('join'))
def test_multi_input_ptransform(self):
class DisjointUnion(PTransform):
[2/2] incubator-beam git commit: This closes #512
Posted by bc...@apache.org.
This closes #512
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/4840f527
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/4840f527
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/4840f527
Branch: refs/heads/python-sdk
Commit: 4840f5275c569c190088179cb5dee6380ae641c9
Parents: f166b16 0608ad9
Author: bchambers <bc...@google.com>
Authored: Tue Jun 21 15:20:27 2016 -0700
Committer: bchambers <bc...@google.com>
Committed: Tue Jun 21 15:20:27 2016 -0700
----------------------------------------------------------------------
sdks/python/apache_beam/transforms/ptransform_test.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------