You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2018/06/13 18:27:55 UTC
[beam] branch master updated (a5ab452 -> ce07fbf)
This is an automated email from the ASF dual-hosted git repository.
altay pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git.
from a5ab452 Futurize portability subpackage (#5385)
new d2ea77f Futurize unpackaged files
new ce07fbf resolved six.string_types equivalency
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
sdks/python/apache_beam/__init__.py | 2 ++
sdks/python/apache_beam/error.py | 2 ++
sdks/python/apache_beam/pipeline.py | 7 +++++--
sdks/python/apache_beam/pipeline_test.py | 4 ++++
sdks/python/apache_beam/pvalue.py | 11 ++++++++---
sdks/python/apache_beam/pvalue_test.py | 2 ++
sdks/python/tox.ini | 5 +++++
7 files changed, 28 insertions(+), 5 deletions(-)
--
To stop receiving notification emails like this one, please contact
altay@apache.org.
[beam] 02/02: resolved six.string_types equivalency
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
altay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
commit ce07fbf17d99cd0e06625ac8b0a3bf7159800972
Author: Matthias Feys <ma...@gmail.com>
AuthorDate: Wed May 16 23:49:38 2018 +0200
resolved six.string_types equivalency
---
sdks/python/apache_beam/pvalue.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdks/python/apache_beam/pvalue.py b/sdks/python/apache_beam/pvalue.py
index 16deb83..3201249 100644
--- a/sdks/python/apache_beam/pvalue.py
+++ b/sdks/python/apache_beam/pvalue.py
@@ -266,7 +266,7 @@ class TaggedOutput(object):
"""
def __init__(self, tag, value):
- if not isinstance(tag, (bytes, unicode)):
+ if not isinstance(tag, (str, unicode)):
raise TypeError(
'Attempting to create a TaggedOutput with non-string tag %s' % tag)
self.tag = tag
--
To stop receiving notification emails like this one, please contact
altay@apache.org.
[beam] 01/02: Futurize unpackaged files
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
altay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
commit d2ea77fe83e4796b5fa02518c53460a861d54519
Author: Matthias Feys <ma...@ml6.eu>
AuthorDate: Wed May 16 20:38:48 2018 +0200
Futurize unpackaged files
---
sdks/python/apache_beam/__init__.py | 2 ++
sdks/python/apache_beam/error.py | 2 ++
sdks/python/apache_beam/pipeline.py | 7 +++++--
sdks/python/apache_beam/pipeline_test.py | 4 ++++
sdks/python/apache_beam/pvalue.py | 11 ++++++++---
sdks/python/apache_beam/pvalue_test.py | 2 ++
sdks/python/tox.ini | 5 +++++
7 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/sdks/python/apache_beam/__init__.py b/sdks/python/apache_beam/__init__.py
index 791ebb7..8bb1a53 100644
--- a/sdks/python/apache_beam/__init__.py
+++ b/sdks/python/apache_beam/__init__.py
@@ -72,6 +72,8 @@ has some examples.
"""
+from __future__ import absolute_import
+
import sys
diff --git a/sdks/python/apache_beam/error.py b/sdks/python/apache_beam/error.py
index 6ecb74f..47fec08 100644
--- a/sdks/python/apache_beam/error.py
+++ b/sdks/python/apache_beam/error.py
@@ -17,6 +17,8 @@
"""Python Dataflow error classes."""
+from __future__ import absolute_import
+
class BeamError(Exception):
"""Base class for all Beam errors."""
diff --git a/sdks/python/apache_beam/pipeline.py b/sdks/python/apache_beam/pipeline.py
index 6abc3de..482afa6 100644
--- a/sdks/python/apache_beam/pipeline.py
+++ b/sdks/python/apache_beam/pipeline.py
@@ -52,6 +52,10 @@ import logging
import os
import shutil
import tempfile
+from builtins import object
+from builtins import zip
+
+from future.utils import with_metaclass
from apache_beam import pvalue
from apache_beam.internal import pickler
@@ -880,7 +884,7 @@ class AppliedPTransform(object):
return result
-class PTransformOverride(object):
+class PTransformOverride(with_metaclass(abc.ABCMeta, object)):
"""For internal use only; no backwards-compatibility guarantees.
Gives a matcher and replacements for matching PTransforms.
@@ -888,7 +892,6 @@ class PTransformOverride(object):
TODO: Update this to support cases where input and/our output types are
different.
"""
- __metaclass__ = abc.ABCMeta
@abc.abstractmethod
def matches(self, applied_ptransform):
diff --git a/sdks/python/apache_beam/pipeline_test.py b/sdks/python/apache_beam/pipeline_test.py
index ed27aa7..d870665 100644
--- a/sdks/python/apache_beam/pipeline_test.py
+++ b/sdks/python/apache_beam/pipeline_test.py
@@ -17,10 +17,14 @@
"""Unit tests for the Pipeline class."""
+from __future__ import absolute_import
+
import copy
import logging
import platform
import unittest
+from builtins import object
+from builtins import range
from collections import defaultdict
import mock
diff --git a/sdks/python/apache_beam/pvalue.py b/sdks/python/apache_beam/pvalue.py
index 3dedf0a..16deb83 100644
--- a/sdks/python/apache_beam/pvalue.py
+++ b/sdks/python/apache_beam/pvalue.py
@@ -28,8 +28,8 @@ from __future__ import absolute_import
import collections
import itertools
-
-from six import string_types
+from builtins import hex
+from builtins import object
from apache_beam import coders
from apache_beam import typehints
@@ -38,6 +38,11 @@ from apache_beam.portability import common_urns
from apache_beam.portability import python_urns
from apache_beam.portability.api import beam_runner_api_pb2
+try:
+ unicode # pylint: disable=unicode-builtin
+except NameError:
+ unicode = str
+
__all__ = [
'PCollection',
'TaggedOutput',
@@ -261,7 +266,7 @@ class TaggedOutput(object):
"""
def __init__(self, tag, value):
- if not isinstance(tag, string_types):
+ if not isinstance(tag, (bytes, unicode)):
raise TypeError(
'Attempting to create a TaggedOutput with non-string tag %s' % tag)
self.tag = tag
diff --git a/sdks/python/apache_beam/pvalue_test.py b/sdks/python/apache_beam/pvalue_test.py
index 48203df..b01902a 100644
--- a/sdks/python/apache_beam/pvalue_test.py
+++ b/sdks/python/apache_beam/pvalue_test.py
@@ -17,6 +17,8 @@
"""Unit tests for the PValue and PCollection classes."""
+from __future__ import absolute_import
+
import unittest
from apache_beam.pvalue import AsSingleton
diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini
index 5ac0223..8958997 100644
--- a/sdks/python/tox.ini
+++ b/sdks/python/tox.ini
@@ -105,6 +105,11 @@ modules =
apache_beam/metrics
apache_beam/options
apache_beam/utils
+ apache_beam/error
+ apache_beam/pipeline
+ apache_beam/pipeline_test
+ apache_beam/pvalue
+ apache_beam/pvalue_test
commands =
python --version
pip --version
--
To stop receiving notification emails like this one, please contact
altay@apache.org.