Skip to content

Commit

Permalink
fixing python function example custom_object_function.py (apache#4946)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusalmeida authored and sijie committed Aug 18, 2019
1 parent 1691cc8 commit 33441ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pulsar-functions/python-examples/custom_object_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def __init__(self):
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])
Expand Down

0 comments on commit 33441ea

Please sign in to comment.