jerrypeng commented on a change in pull request #2762: Fix IdentitySerde
URL: https://github.com/apache/pulsar/pull/2762#discussion_r224171356
 
 

 ##########
 File path: pulsar-client-cpp/python/pulsar/functions/serde.py
 ##########
 @@ -68,9 +68,9 @@ def deserialize(self, input_bytes):
       return pickle.loads(input_bytes)
 
 class IdentitySerDe(SerDe):
-  """Pickle based serializer"""
+  """utf-8 based identity serializer"""
   def serialize(self, input):
-    return input
+    return bytes(str(input).encode('utf-8'))
 
 Review comment:
   how can we assume that the string representation of the object is 
meaningful?  The identity serde is also used as the default serde in python 
which is going to cause errors if users inputs/outputs anything other than 
Strings 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to