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/07/19 00:50:19 UTC
[2/4] incubator-beam git commit: Used fast primitives coder as
fallback coder.
Used fast primitives coder as fallback coder.
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/64457d04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/64457d04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/64457d04
Branch: refs/heads/python-sdk
Commit: 64457d04f60859c7f0ef53c9d847090a9fa754e4
Parents: f58c2bd
Author: Robert Bradshaw <ro...@google.com>
Authored: Mon Jul 18 14:25:08 2016 -0700
Committer: Robert Bradshaw <ro...@google.com>
Committed: Mon Jul 18 17:48:33 2016 -0700
----------------------------------------------------------------------
sdks/python/apache_beam/coders/coders.py | 2 +-
sdks/python/apache_beam/coders/typecoders.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/64457d04/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 cf5ca6d..1c5043c 100644
--- a/sdks/python/apache_beam/coders/coders.py
+++ b/sdks/python/apache_beam/coders/coders.py
@@ -359,7 +359,7 @@ class FastPrimitivesCoder(FastCoder):
For unknown types, falls back to another coder (e.g. PickleCoder).
"""
- def __init__(self, fallback_coder):
+ def __init__(self, fallback_coder=PickleCoder()):
self._fallback_coder = fallback_coder
def _create_impl(self):
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/64457d04/sdks/python/apache_beam/coders/typecoders.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/coders/typecoders.py b/sdks/python/apache_beam/coders/typecoders.py
index 2fba752..74e5770 100644
--- a/sdks/python/apache_beam/coders/typecoders.py
+++ b/sdks/python/apache_beam/coders/typecoders.py
@@ -86,9 +86,9 @@ class CoderRegistry(object):
self._register_coder_internal(bytes, coders.BytesCoder)
self._register_coder_internal(unicode, coders.StrUtf8Coder)
self._register_coder_internal(typehints.TupleConstraint, coders.TupleCoder)
+ self._fallback_coder = fallback_coder or coders.FastPrimitivesCoder
self._register_coder_internal(typehints.AnyTypeConstraint,
- coders.PickleCoder)
- self._fallback_coder = fallback_coder or coders.PickleCoder
+ self._fallback_coder)
def _register_coder_internal(self, typehint_type, typehint_coder_class):
self._coders[typehint_type] = typehint_coder_class