You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/05/31 23:19:08 UTC

[GitHub] jerrypeng closed pull request #1878: Make sure that output_bytes are of type bytes

jerrypeng closed pull request #1878: Make sure that output_bytes are of type bytes
URL: https://github.com/apache/incubator-pulsar/pull/1878
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pulsar-functions/instance/src/main/python/contextimpl.py b/pulsar-functions/instance/src/main/python/contextimpl.py
index 3463d7ba4d..dea4ca0220 100644
--- a/pulsar-functions/instance/src/main/python/contextimpl.py
+++ b/pulsar-functions/instance/src/main/python/contextimpl.py
@@ -134,7 +134,7 @@ def publish(self, topic_name, message, serde_class_name):
       serde_klass = util.import_class(self.user_code_dir, serde_class_name)
       self.publish_serializers[serde_class_name] = serde_klass()
 
-    output_bytes = self.publish_serializers[serde_class_name].serialize(message)
+    output_bytes = bytes(self.publish_serializers[serde_class_name].serialize(message))
     self.publish_producers[topic_name].send_async(output_bytes, None)
 
   def ack(self, msgid, topic):
diff --git a/pulsar-functions/instance/src/main/python/python_instance.py b/pulsar-functions/instance/src/main/python/python_instance.py
index 6a82b0ad19..7d6dc650c5 100644
--- a/pulsar-functions/instance/src/main/python/python_instance.py
+++ b/pulsar-functions/instance/src/main/python/python_instance.py
@@ -233,7 +233,7 @@ def process_result(self, output, msg):
       if self.producer is None:
         self.setup_producer()
       try:
-        output_bytes = self.output_serde.serialize(output)
+        output_bytes = bytes(self.output_serde.serialize(output))
       except:
         self.current_stats.nserialization_exceptions += 1
         self.total_stats.nserialization_exceptions += 1


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services