pulsar-client-python icon indicating copy to clipboard operation
pulsar-client-python copied to clipboard

Python client send a 'null' schema data for StringSchema

Open sijie opened this issue 6 years ago • 5 comments
trafficstars

Describe the bug

Python client uses json.dump(None) to generate the schema info for StringSchema. It causes the python client sends a schema info with "null" schema data.

Expected behavior

Python client should send empty schema data for primitive schema types.

sijie avatar Jun 20 '19 05:06 sijie

The problem was identified when working on apache/pulsar#4360

sijie avatar Jun 20 '19 05:06 sijie

@BewareMyPower I don't know whether it's still relevant so you can triage it and close if invalid anymore.

tisonkun avatar Nov 09 '22 16:11 tisonkun

We can keep this issue open while I didn't look into this issue.

BewareMyPower avatar Nov 10 '22 03:11 BewareMyPower

If i'm understanding this correctly, the problem is in the following lines of schema.py:

class StringSchema(Schema):
    def __init__(self):
        super(StringSchema, self).__init__(str, _pulsar.SchemaType.STRING, None, 'STRING')

Rather than None, would it be more appropriate to send an empty string?

erichare avatar Feb 16 '23 14:02 erichare

@erichare I think we need a test to reproduce this bug because currently all tests passed, i.e. this bug is not covered.

BewareMyPower avatar Feb 17 '23 06:02 BewareMyPower