You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by si...@apache.org on 2019/08/18 17:01:39 UTC
[pulsar] branch master updated: fixing python function example
custom_object_function.py (#4946)
This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 33441ea fixing python function example custom_object_function.py (#4946)
33441ea is described below
commit 33441ea0d13322f3d444de8781e8c4c655e6a61e
Author: marcusalmeida <ma...@gmail.com>
AuthorDate: Sun Aug 18 14:01:34 2019 -0300
fixing python function example custom_object_function.py (#4946)
---
pulsar-functions/python-examples/custom_object_function.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pulsar-functions/python-examples/custom_object_function.py b/pulsar-functions/python-examples/custom_object_function.py
index 53ba597..0da0c92 100755
--- a/pulsar-functions/python-examples/custom_object_function.py
+++ b/pulsar-functions/python-examples/custom_object_function.py
@@ -31,10 +31,10 @@ class CustomSerDe(SerDe):
pass
def serialize(self, object):
- return "%d,%d" % (object.a, object.b)
+ return ("%d,%d" % (object.a, object.b)).encode('utf-8')
def deserialize(self, input_bytes):
- split = str(input_bytes).split(',')
+ split = str(input_bytes.decode()).split(',')
retval = MyObject()
retval.a = int(split[0])
retval.b = int(split[1])