gaoran10 commented on a change in pull request #11400: URL: https://github.com/apache/pulsar/pull/11400#discussion_r674055519
########## File path: pulsar-client-cpp/python/pulsar/schema/schema_avro.py ########## @@ -45,14 +46,23 @@ def _get_serialized_value(self, x): def encode(self, obj): self._validate_object_type(obj) buffer = io.BytesIO() - m = {k: self._get_serialized_value(v) for k, v in obj.__dict__.items()} + m = self.encode_dict(obj.__dict__) fastavro.schemaless_writer(buffer, self._schema, m) return buffer.getvalue() + def encode_dict(self, d: dict): + obj = {} + for k, v in d.items(): + if isinstance(v, Record): + obj[k] = self.encode_dict(v.__dict__) Review comment: I fixed this. PTAL -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org