def _decode_bytes()

in pulsar/schema/schema_avro.py [0:0]


        def _decode_bytes(self, data: bytes, writer_schema: dict):
            buffer = io.BytesIO(data)
            # If the record names are different between the writer schema and the reader schema,
            # schemaless_reader will fail with fastavro._read_common.SchemaResolutionError.
            # So we make the record name fields consistent here.
            reader_schema: dict = self._schema
            writer_schema['name'] = reader_schema['name']
            d = fastavro.schemaless_reader(buffer, writer_schema, reader_schema)
            if self._record_cls is not None:
                return self._record_cls(**d)
            else:
                return d