You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ro...@apache.org on 2016/09/22 23:19:00 UTC

[1/3] incubator-beam git commit: Using strings instead of integers for identifying CompressionTypes.

Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 9565b2c27 -> 0fa9c4be6


Using strings instead of integers for identifying CompressionTypes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/8403ec1c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/8403ec1c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/8403ec1c

Branch: refs/heads/python-sdk
Commit: 8403ec1c446cc825eb81a46588a1222fcd42f523
Parents: 04d84c9
Author: Gus Katsiapis <ka...@katsiapis-linux.mtv.corp.google.com>
Authored: Thu Sep 22 13:15:51 2016 -0700
Committer: Robert Bradshaw <ro...@google.com>
Committed: Thu Sep 22 16:18:28 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/io/fileio.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/8403ec1c/sdks/python/apache_beam/io/fileio.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/io/fileio.py b/sdks/python/apache_beam/io/fileio.py
index 6c254c7..54ca891 100644
--- a/sdks/python/apache_beam/io/fileio.py
+++ b/sdks/python/apache_beam/io/fileio.py
@@ -67,20 +67,20 @@ class CompressionTypes(object):
   #   .gz (implies GZIP as described below)
   #   .z  (implies ZLIB as described below).
   # Any non-recognized extension implies UNCOMPRESSED as described below.
-  AUTO = _CompressionType(1)
+  AUTO = _CompressionType('auto')
 
   # GZIP compression (deflate with GZIP headers).
-  GZIP = _CompressionType(2)
+  GZIP = _CompressionType('gzip')
 
   # ZLIB compression (deflate with ZLIB headers).
-  ZLIB = _CompressionType(3)
+  ZLIB = _CompressionType('zlib')
 
   # Uncompressed (i.e., may be split).
-  UNCOMPRESSED = _CompressionType(4)
+  UNCOMPRESSED = _CompressionType('uncompressed')
 
   # TODO: Remove this backwards-compatibility soon.
-  NO_COMPRESSION = _CompressionType(4)  # Deprecated. Use UNCOMPRESSED instead.
-  assert NO_COMPRESSION == UNCOMPRESSED
+  # Deprecated. Use UNCOMPRESSED instead.
+  NO_COMPRESSION = UNCOMPRESSED
 
   @classmethod
   def is_valid_compression_type(cls, compression_type):


[2/3] incubator-beam git commit: Better documentation for CompressionTypes.

Posted by ro...@apache.org.
Better documentation for CompressionTypes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/04d84c99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/04d84c99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/04d84c99

Branch: refs/heads/python-sdk
Commit: 04d84c996a14b557647a4c85703a29fbeaaa0db6
Parents: 9565b2c
Author: Gus Katsiapis <ka...@katsiapis-linux.mtv.corp.google.com>
Authored: Thu Sep 22 10:25:45 2016 -0700
Committer: Robert Bradshaw <ro...@google.com>
Committed: Thu Sep 22 16:18:28 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/io/fileio.py | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/04d84c99/sdks/python/apache_beam/io/fileio.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/io/fileio.py b/sdks/python/apache_beam/io/fileio.py
index d640d50..6c254c7 100644
--- a/sdks/python/apache_beam/io/fileio.py
+++ b/sdks/python/apache_beam/io/fileio.py
@@ -60,10 +60,23 @@ class _CompressionType(object):
 
 class CompressionTypes(object):
   """Enum-like class representing known compression types."""
-  AUTO = _CompressionType(1)  # Detect compression based on filename extension.
-  GZIP = _CompressionType(2)  # gzip compression (deflate with gzip headers).
-  ZLIB = _CompressionType(3)  # zlib compression (deflate with zlib headers).
-  UNCOMPRESSED = _CompressionType(4)  # Uncompressed (i.e., may be split).
+
+  # Detect compression based on filename extension.
+  #
+  # The following extensions are currently recognized by auto-detection:
+  #   .gz (implies GZIP as described below)
+  #   .z  (implies ZLIB as described below).
+  # Any non-recognized extension implies UNCOMPRESSED as described below.
+  AUTO = _CompressionType(1)
+
+  # GZIP compression (deflate with GZIP headers).
+  GZIP = _CompressionType(2)
+
+  # ZLIB compression (deflate with ZLIB headers).
+  ZLIB = _CompressionType(3)
+
+  # Uncompressed (i.e., may be split).
+  UNCOMPRESSED = _CompressionType(4)
 
   # TODO: Remove this backwards-compatibility soon.
   NO_COMPRESSION = _CompressionType(4)  # Deprecated. Use UNCOMPRESSED instead.


[3/3] incubator-beam git commit: Closes #989

Posted by ro...@apache.org.
Closes #989


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/0fa9c4be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/0fa9c4be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/0fa9c4be

Branch: refs/heads/python-sdk
Commit: 0fa9c4be6185e15129447983173ae036f9d4fa89
Parents: 9565b2c 8403ec1
Author: Robert Bradshaw <ro...@google.com>
Authored: Thu Sep 22 16:18:29 2016 -0700
Committer: Robert Bradshaw <ro...@google.com>
Committed: Thu Sep 22 16:18:29 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/io/fileio.py | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------