You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2018/08/03 22:35:57 UTC

[beam] 01/01: Use the same language semantics as defined by version of the interpreter for Cythonizing. Use `past.builtins.basestring` consistently to type-check strings.

This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch release-2.6.0
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 163e0f093c9d4d29b33b998802b277d4f6956f5e
Author: Valentyn Tymofieiev <va...@google.com>
AuthorDate: Fri Aug 3 11:32:07 2018 -0700

    Use the same language semantics as defined by version of the interpreter for
    Cythonizing. Use `past.builtins.basestring` consistently to type-check strings.
---
 sdks/python/apache_beam/runners/common.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sdks/python/apache_beam/runners/common.py b/sdks/python/apache_beam/runners/common.py
index aa43559..38ae666 100644
--- a/sdks/python/apache_beam/runners/common.py
+++ b/sdks/python/apache_beam/runners/common.py
@@ -15,7 +15,6 @@
 # limitations under the License.
 #
 
-# cython: language_level=3
 # cython: profile=True
 
 """Worker operations executor.
@@ -33,7 +32,6 @@ from builtins import zip
 
 from future.utils import raise_
 from past.builtins import basestring
-from past.builtins import unicode
 
 from apache_beam.internal import util
 from apache_beam.options.value_provider import RuntimeValueProvider
@@ -726,7 +724,7 @@ class _OutputProcessor(OutputProcessor):
       tag = None
       if isinstance(result, TaggedOutput):
         tag = result.tag
-        if not isinstance(tag, (str, unicode)):
+        if not isinstance(tag, basestring):
           raise TypeError('In %s, tag %s is not a string' % (self, tag))
         result = result.value