From 797b4b82fb53cb7a00238d31c9b0c1bd70e93632 Mon Sep 17 00:00:00 2001 From: marcusalmeida Date: Sun, 18 Aug 2019 14:01:34 -0300 Subject: [PATCH] fixing python function example custom_object_function.py (#4946) (cherry picked from commit 33441ea0d13322f3d444de8781e8c4c655e6a61e) --- 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 53ba5974457..0da0c92ffd1 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]) -- GitLab