pulsar-client-python
pulsar-client-python copied to clipboard
Python client send a 'null' schema data for StringSchema
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.
The problem was identified when working on apache/pulsar#4360
@BewareMyPower I don't know whether it's still relevant so you can triage it and close if invalid anymore.
We can keep this issue open while I didn't look into this issue.
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 I think we need a test to reproduce this bug because currently all tests passed, i.e. this bug is not covered.