Repository: beam Updated Branches: refs/heads/DSL_SQL 97a156c30 -> 152115e89
http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/apache_beam/typehints/trivial_inference.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/typehints/trivial_inference.py b/sdks/python/apache_beam/typehints/trivial_inference.py index c740596..977ea06 100644 --- a/sdks/python/apache_beam/typehints/trivial_inference.py +++ b/sdks/python/apache_beam/typehints/trivial_inference.py @@ -40,7 +40,8 @@ def instance_to_type(o): """ t = type(o) if o is None: - return type(None) + # TODO(robertwb): Eliminate inconsistent use of None vs. NoneType. + return None elif t not in typehints.DISALLOWED_PRIMITIVE_TYPES: if t == types.InstanceType: return o.__class__ http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/apache_beam/typehints/trivial_inference_test.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/typehints/trivial_inference_test.py b/sdks/python/apache_beam/typehints/trivial_inference_test.py index e7f451d..ac00baa 100644 --- a/sdks/python/apache_beam/typehints/trivial_inference_test.py +++ b/sdks/python/apache_beam/typehints/trivial_inference_test.py @@ -60,13 +60,6 @@ class TrivialInferenceTest(unittest.TestCase): self.assertReturnType(any_tuple, reverse, [trivial_inference.Const((1, 2, 3))]) - def testNoneReturn(self): - def func(a): - if a == 5: - return a - return None - self.assertReturnType(typehints.Union[int, type(None)], func, [int]) - def testListComprehension(self): self.assertReturnType( typehints.List[int], http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/apache_beam/utils/plugin.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/plugin.py b/sdks/python/apache_beam/utils/plugin.py deleted file mode 100644 index 563b93c..0000000 --- a/sdks/python/apache_beam/utils/plugin.py +++ /dev/null @@ -1,42 +0,0 @@ -# -# 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. -# - -"""A BeamPlugin base class. - -For experimental usage only; no backwards-compatibility guarantees. -""" - - -class BeamPlugin(object): - """Plugin base class to be extended by dependent users such as FileSystem. - Any instantiated subclass will be imported at worker startup time.""" - - @classmethod - def get_all_subclasses(cls): - """Get all the subclasses of the BeamPlugin class.""" - all_subclasses = [] - for subclass in cls.__subclasses__(): - all_subclasses.append(subclass) - all_subclasses.extend(subclass.get_all_subclasses()) - return all_subclasses - - @classmethod - def get_all_plugin_paths(cls): - """Get full import paths of the BeamPlugin subclass.""" - def fullname(o): - return o.__module__ + "." + o.__name__ - return [fullname(o) for o in cls.get_all_subclasses()] http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/apache_beam/utils/timestamp.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/timestamp.py b/sdks/python/apache_beam/utils/timestamp.py index b3e840e..5d1b48c 100644 --- a/sdks/python/apache_beam/utils/timestamp.py +++ b/sdks/python/apache_beam/utils/timestamp.py @@ -208,8 +208,3 @@ class Duration(object): def __mod__(self, other): other = Duration.of(other) return Duration(micros=self.micros % other.micros) - - -# The minimum granularity / interval expressible in a Timestamp / Duration -# object. -TIME_GRANULARITY = Duration(micros=1) http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/apache_beam/utils/urns.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/utils/urns.py b/sdks/python/apache_beam/utils/urns.py index e553eea..849b8e3 100644 --- a/sdks/python/apache_beam/utils/urns.py +++ b/sdks/python/apache_beam/utils/urns.py @@ -102,7 +102,7 @@ class RunnerApiFn(object): Prefer overriding self.to_runner_api_parameter. """ - from apache_beam.portability.api import beam_runner_api_pb2 + from apache_beam.runners.api import beam_runner_api_pb2 urn, typed_param = self.to_runner_api_parameter(context) return beam_runner_api_pb2.SdkFunctionSpec( spec=beam_runner_api_pb2.FunctionSpec( http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/apache_beam/version.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/version.py b/sdks/python/apache_beam/version.py index 8b0a430..ae92a23 100644 --- a/sdks/python/apache_beam/version.py +++ b/sdks/python/apache_beam/version.py @@ -18,4 +18,4 @@ """Apache Beam SDK version information and utilities.""" -__version__ = '2.2.0.dev' +__version__ = '2.1.0.dev' http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/gen_protos.py ---------------------------------------------------------------------- diff --git a/sdks/python/gen_protos.py b/sdks/python/gen_protos.py index a3d963d..92b8414 100644 --- a/sdks/python/gen_protos.py +++ b/sdks/python/gen_protos.py @@ -35,7 +35,7 @@ BEAM_PROTO_PATHS = [ os.path.join('..', 'common', 'fn-api', 'src', 'main', 'proto') ] -PYTHON_OUTPUT_PATH = os.path.join('apache_beam', 'portability', 'api') +PYTHON_OUTPUT_PATH = os.path.join('apache_beam', 'runners', 'api') def generate_proto_files(): http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/pom.xml ---------------------------------------------------------------------- diff --git a/sdks/python/pom.xml b/sdks/python/pom.xml index 1077689..1295654 100644 --- a/sdks/python/pom.xml +++ b/sdks/python/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.apache.beam</groupId> <artifactId>beam-sdks-parent</artifactId> - <version>2.2.0-SNAPSHOT</version> + <version>2.1.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/run_pylint.sh ---------------------------------------------------------------------- diff --git a/sdks/python/run_pylint.sh b/sdks/python/run_pylint.sh index 2691be4..7808136 100755 --- a/sdks/python/run_pylint.sh +++ b/sdks/python/run_pylint.sh @@ -46,7 +46,7 @@ EXCLUDED_GENERATED_FILES=( "apache_beam/io/gcp/internal/clients/storage/storage_v1_client.py" "apache_beam/io/gcp/internal/clients/storage/storage_v1_messages.py" "apache_beam/coders/proto2_coder_test_messages_pb2.py" -apache_beam/portability/api/*pb2*.py +apache_beam/runners/api/*pb2*.py ) FILES_TO_IGNORE="" http://git-wip-us.apache.org/repos/asf/beam/blob/c1b2b96a/sdks/python/setup.py ---------------------------------------------------------------------- diff --git a/sdks/python/setup.py b/sdks/python/setup.py index da82466..051043b 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -112,17 +112,14 @@ REQUIRED_SETUP_PACKAGES = [ REQUIRED_TEST_PACKAGES = [ 'pyhamcrest>=1.9,<2.0', - # Six required by nose plugins management. - 'six>=1.9', ] GCP_REQUIREMENTS = [ 'google-apitools>=0.5.10,<=0.5.11', 'proto-google-cloud-datastore-v1>=0.90.0,<=0.90.4', 'googledatastore==7.0.1', - 'google-cloud-pubsub==0.26.0', # GCP packages required by tests - 'google-cloud-bigquery==0.25.0', + 'google-cloud-bigquery>=0.23.0,<0.25.0', ]
