Repository: incubator-beam Updated Branches: refs/heads/python-sdk cb2afa4e8 -> 77f90ff15
Remove more tests from nose tests exclusion list * Remove examples from the nose tests exclusion list * Remove non-existent tests from the exclusion list * process_argspec_fn for CombinePerKey Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/44f784e2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/44f784e2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/44f784e2 Branch: refs/heads/python-sdk Commit: 44f784e298977073c16c1dcc8ae5282e08fdfc34 Parents: cb2afa4 Author: Ahmet Altay <[email protected]> Authored: Mon Jul 11 17:08:40 2016 -0700 Committer: Dan Halperin <[email protected]> Committed: Tue Jul 12 12:01:40 2016 -0700 ---------------------------------------------------------------------- .../apache_beam/examples/complete/__init__.py | 16 ++++++++++++++++ .../apache_beam/examples/cookbook/__init__.py | 16 ++++++++++++++++ .../examples/cookbook/bigquery_side_input_test.py | 14 ++++---------- sdks/python/apache_beam/transforms/core.py | 3 +++ sdks/python/setup.cfg | 14 ++------------ 5 files changed, 41 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/44f784e2/sdks/python/apache_beam/examples/complete/__init__.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/examples/complete/__init__.py b/sdks/python/apache_beam/examples/complete/__init__.py new file mode 100644 index 0000000..cce3aca --- /dev/null +++ b/sdks/python/apache_beam/examples/complete/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/44f784e2/sdks/python/apache_beam/examples/cookbook/__init__.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/examples/cookbook/__init__.py b/sdks/python/apache_beam/examples/cookbook/__init__.py new file mode 100644 index 0000000..cce3aca --- /dev/null +++ b/sdks/python/apache_beam/examples/cookbook/__init__.py @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/44f784e2/sdks/python/apache_beam/examples/cookbook/bigquery_side_input_test.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/examples/cookbook/bigquery_side_input_test.py b/sdks/python/apache_beam/examples/cookbook/bigquery_side_input_test.py index c16518f..bc75c41 100644 --- a/sdks/python/apache_beam/examples/cookbook/bigquery_side_input_test.py +++ b/sdks/python/apache_beam/examples/cookbook/bigquery_side_input_test.py @@ -44,16 +44,10 @@ class BigQuerySideInputTest(unittest.TestCase): words_pcoll, ignore_corpus_pcoll, ignore_word_pcoll) - def group_matcher(actual): - self.assertEqual(len(actual), 3) - for group in actual: - self.assertEqual(len(group), 3) - self.assertTrue(group[1].startswith('corpus')) - self.assertNotEqual(group[1], 'corpus1') - self.assertTrue(group[2].startswith('word')) - self.assertNotEqual(group[2], 'word1') - - beam.assert_that(groups, group_matcher) + beam.assert_that(groups, beam.equal_to( + [('A', 'corpus2', 'word2'), + ('B', 'corpus2', 'word2'), + ('C', 'corpus2', 'word2')])) p.run() http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/44f784e2/sdks/python/apache_beam/transforms/core.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/transforms/core.py b/sdks/python/apache_beam/transforms/core.py index 15247f2..177a5cf 100644 --- a/sdks/python/apache_beam/transforms/core.py +++ b/sdks/python/apache_beam/transforms/core.py @@ -882,6 +882,9 @@ class CombinePerKey(PTransformWithSideInputs): def default_label(self): return '%s(%s)' % (self.__class__.__name__, self._fn_label) + def process_argspec_fn(self): + return self.fn._fn # pylint: disable=protected-access + def apply(self, pcoll): args, kwargs = util.insert_values_in_args( self.args, self.kwargs, self.side_inputs) http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/44f784e2/sdks/python/setup.cfg ---------------------------------------------------------------------- diff --git a/sdks/python/setup.cfg b/sdks/python/setup.cfg index 317121f..547a74b 100644 --- a/sdks/python/setup.cfg +++ b/sdks/python/setup.cfg @@ -19,20 +19,10 @@ # Allow discovery of Python test files marked executable. exe=True verbosity=2 -# Exclude some unit tests because they define command line options. Nose runs -# tests by loading the corresponding modules in the same process and the -# side-effect of defining command line options makes other tests fail. -# # TODO(silviuc): Find a way to run the remaining tests excluded here. # # The following tests are excluded because they try to load the Cython-based # fast_coders module which is not available when running unit tests: -# fast_coders_test, typecoders_test, workitem_test, and executor_test. -# -# The streamingworker_test test is excluded because it depends on protobuf and -# gRPC. -# -# The batchworker_test is excluded because it imports batchworker.py which -# in-turn tries to import module 'resource' which does not work for Windows. -exclude=examples|bigquery_test|fast_coders_test|typecoders_test|workitem_test|executor_test|streamingworker_test|batchworker_test +# fast_coders_test and typecoders_test. +exclude=fast_coders_test|typecoders_test
