You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2017/06/08 03:09:01 UTC

[1/2] beam git commit: Make BytesCoder to be a known type

Repository: beam
Updated Branches:
  refs/heads/master 66460cb2d -> 0a0a1bc74


Make BytesCoder to be a known type


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

Branch: refs/heads/master
Commit: d94ac58ea2d12f55743e8ad27a02bdb83c194da7
Parents: 66460cb
Author: Vikas Kedigehalli <vi...@google.com>
Authored: Wed Jun 7 16:26:21 2017 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jun 7 20:05:40 2017 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/coders/coders.py                  | 5 +++++
 sdks/python/apache_beam/runners/worker/operation_specs.py | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/d94ac58e/sdks/python/apache_beam/coders/coders.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/coders/coders.py b/sdks/python/apache_beam/coders/coders.py
index f40045d..f3e0b43 100644
--- a/sdks/python/apache_beam/coders/coders.py
+++ b/sdks/python/apache_beam/coders/coders.py
@@ -286,6 +286,11 @@ class BytesCoder(FastCoder):
   def is_deterministic(self):
     return True
 
+  def as_cloud_object(self):
+    return {
+        '@type': 'kind:bytes',
+    }
+
   def __eq__(self, other):
     return type(self) == type(other)
 

http://git-wip-us.apache.org/repos/asf/beam/blob/d94ac58e/sdks/python/apache_beam/runners/worker/operation_specs.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/runners/worker/operation_specs.py b/sdks/python/apache_beam/runners/worker/operation_specs.py
index db5eb76..b8d19a1 100644
--- a/sdks/python/apache_beam/runners/worker/operation_specs.py
+++ b/sdks/python/apache_beam/runners/worker/operation_specs.py
@@ -339,6 +339,10 @@ def get_coder_from_spec(coder_spec):
     assert len(coder_spec['component_encodings']) == 1
     return coders.coders.LengthPrefixCoder(
         get_coder_from_spec(coder_spec['component_encodings'][0]))
+  elif coder_spec['@type'] == 'kind:bytes':
+    assert ('component_encodings' not in coder_spec
+            or len(coder_spec['component_encodings'] == 0))
+    return coders.BytesCoder()
 
   # We pass coders in the form "<coder_name>$<pickled_data>" to make the job
   # description JSON more readable.


[2/2] beam git commit: [BEAM-1226] Make BytesCoder to be a known type

Posted by lc...@apache.org.
[BEAM-1226] Make BytesCoder to be a known type

This closes #3316


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

Branch: refs/heads/master
Commit: 0a0a1bc7493ad71f1a70b1c9921ba09ecfe4c2e8
Parents: 66460cb d94ac58
Author: Luke Cwik <lc...@google.com>
Authored: Wed Jun 7 20:08:49 2017 -0700
Committer: Luke Cwik <lc...@google.com>
Committed: Wed Jun 7 20:08:49 2017 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/coders/coders.py                  | 5 +++++
 sdks/python/apache_beam/runners/worker/operation_specs.py | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------