[ 
https://issues.apache.org/jira/browse/BEAM-13052?focusedWorklogId=672833&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-672833
 ]

ASF GitHub Bot logged work on BEAM-13052:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Nov/21 20:04
            Start Date: 01/Nov/21 20:04
    Worklog Time Spent: 10m 
      Work Description: dpcollins-google commented on a change in pull request 
#15817:
URL: https://github.com/apache/beam/pull/15817#discussion_r740494147



##########
File path: sdks/python/apache_beam/coders/coder_impl.py
##########
@@ -310,6 +311,19 @@ def encode(self, value):
     return value.SerializePartialToString(deterministic=True)
 
 
+class ProtoPlusCoderImpl(SimpleCoderImpl):
+  """For internal use only; no backwards-compatibility guarantees."""
+  def __init__(self, proto_plus_type):
+    # type: (Type[proto.Message]) -> None
+    self.proto_plus_type = proto_plus_type
+
+  def encode(self, value):
+    return value._pb.SerializePartialToString(deterministic=True)
+
+  def decode(self, value):
+    return self.proto_plus_type.deserialize(value)

Review comment:
       This is the preferred way to deserialize proto plus types. I can't use 
the serialize method on line 321 because it is not deterministic, so must drop 
down to the protobuf interface to do so.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 672833)
    Time Spent: 3h 40m  (was: 3.5h)

> Pub/Sub Lite support for Python SDK
> -----------------------------------
>
>                 Key: BEAM-13052
>                 URL: https://issues.apache.org/jira/browse/BEAM-13052
>             Project: Beam
>          Issue Type: New Feature
>          Components: io-py-gcp
>            Reporter: Chamikara Madhusanka Jayalath
>            Assignee: Daniel Collins
>            Priority: P2
>          Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> Potentially we can make existing Java source/sink available to Python as 
> cross-language transforms.
>  
> cc: [~dpcollins-google]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to