From de650ae9fad94d9f6a9155a527011c1d53530a28 Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Wed, 10 May 2017 23:20:20 -0700 Subject: [PATCH 1/2] Add __all__ tags to modules in package apache_beam/testing --- sdks/python/apache_beam/testing/pipeline_verifiers.py | 8 ++++++++ sdks/python/apache_beam/testing/test_pipeline.py | 5 +++++ sdks/python/apache_beam/testing/test_stream.py | 9 +++++++++ sdks/python/apache_beam/testing/test_utils.py | 7 +++++++ 4 files changed, 29 insertions(+) diff --git a/sdks/python/apache_beam/testing/pipeline_verifiers.py b/sdks/python/apache_beam/testing/pipeline_verifiers.py index 5a6082aaee50..a08eb5409cdd 100644 --- a/sdks/python/apache_beam/testing/pipeline_verifiers.py +++ b/sdks/python/apache_beam/testing/pipeline_verifiers.py @@ -32,6 +32,14 @@ from apache_beam.testing import test_utils as utils from apache_beam.utils import retry + +__all__ = [ + 'PipelineStateMatcher', + 'FileChecksumMatcher', + 'retry_on_io_error_and_server_error', + ] + + try: from apitools.base.py.exceptions import HttpError except ImportError: diff --git a/sdks/python/apache_beam/testing/test_pipeline.py b/sdks/python/apache_beam/testing/test_pipeline.py index 20f4839bdb2b..13b1639ea499 100644 --- a/sdks/python/apache_beam/testing/test_pipeline.py +++ b/sdks/python/apache_beam/testing/test_pipeline.py @@ -27,6 +27,11 @@ from nose.plugins.skip import SkipTest +__all__ = [ + 'TestPipeline', + ] + + class TestPipeline(Pipeline): """TestPipeline class is used inside of Beam tests that can be configured to run against pipeline runner. diff --git a/sdks/python/apache_beam/testing/test_stream.py b/sdks/python/apache_beam/testing/test_stream.py index 7ae27b74734e..7c70421e83e4 100644 --- a/sdks/python/apache_beam/testing/test_stream.py +++ b/sdks/python/apache_beam/testing/test_stream.py @@ -28,6 +28,15 @@ from apache_beam.utils.windowed_value import WindowedValue +__all__ = [ + 'Event', + 'ElementEvent', + 'WatermarkEvent', + 'ProcessingTimeEvent', + 'TestStream', + ] + + class Event(object): """Test stream event to be emitted during execution of a TestStream.""" diff --git a/sdks/python/apache_beam/testing/test_utils.py b/sdks/python/apache_beam/testing/test_utils.py index 666207eb4d75..f04507311cc7 100644 --- a/sdks/python/apache_beam/testing/test_utils.py +++ b/sdks/python/apache_beam/testing/test_utils.py @@ -23,6 +23,13 @@ from apache_beam.utils import retry + +__all__ = [ + 'compute_hash', + 'patch_retry', + ] + + DEFAULT_HASHING_ALG = 'sha1' From e6513cf95326309fcb1dd782ba285359ecb1108f Mon Sep 17 00:00:00 2001 From: Charles Chen Date: Thu, 11 May 2017 11:06:38 -0700 Subject: [PATCH 2/2] Add internal use message. --- sdks/python/apache_beam/testing/test_stream.py | 5 ++++- sdks/python/apache_beam/testing/test_utils.py | 11 ++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdks/python/apache_beam/testing/test_stream.py b/sdks/python/apache_beam/testing/test_stream.py index 7c70421e83e4..a06bcd0795f2 100644 --- a/sdks/python/apache_beam/testing/test_stream.py +++ b/sdks/python/apache_beam/testing/test_stream.py @@ -15,7 +15,10 @@ # limitations under the License. # -"""Provides TestStream for verifying streaming runner semantics.""" +"""Provides TestStream for verifying streaming runner semantics. + +For internal use only; no backwards-compatibility guarantees. +""" from abc import ABCMeta from abc import abstractmethod diff --git a/sdks/python/apache_beam/testing/test_utils.py b/sdks/python/apache_beam/testing/test_utils.py index f04507311cc7..9feb80e144e6 100644 --- a/sdks/python/apache_beam/testing/test_utils.py +++ b/sdks/python/apache_beam/testing/test_utils.py @@ -15,7 +15,10 @@ # limitations under the License. # -"""Utility methods for testing""" +"""Utility methods for testing + +For internal use only; no backwards-compatibility guarantees. +""" import hashlib import imp @@ -24,12 +27,6 @@ from apache_beam.utils import retry -__all__ = [ - 'compute_hash', - 'patch_retry', - ] - - DEFAULT_HASHING_ALG = 'sha1'