You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/11/01 20:01:34 UTC
[GitHub] [beam] dpcollins-google commented on a change in pull request #15817: [BEAM-13052] Implement ProtoPlusCoder and add it to the default options
dpcollins-google commented on a change in pull request #15817:
URL: https://github.com/apache/beam/pull/15817#discussion_r740492418
##########
File path: sdks/python/apache_beam/coders/coders.py
##########
@@ -1014,6 +1016,42 @@ def as_deterministic_coder(self, step_label, error_message=None):
return self
+class ProtoPlusCoder(FastCoder):
+ """A Coder for Google Protocol Buffers wrapped using the proto-plus library.
+
+ ProtoPlusCoder is registered in the global CoderRegistry as the default coder
+ for any proto.Message object.
+ """
+ def __init__(self, proto_plus_message_type):
+ # type: (Type[proto.Message]) -> None
+ self.proto_plus_message_type = proto_plus_message_type
+
+ def _create_impl(self):
+ return coder_impl.ProtoPlusCoderImpl(self.proto_plus_message_type)
+
+ def is_deterministic(self):
+ return True
Review comment:
Yes- it uses the deterministic proto coder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org