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 2022/05/30 14:16:16 UTC

[GitHub] [pulsar] zhavir opened a new issue, #15844: Python Client doesn't clean up reserved field when publishing message with Schema

zhavir opened a new issue, #15844:
URL: https://github.com/apache/pulsar/issues/15844

   **Describe the bug**
   If you have a complex schema, the reserved keys `_default`, `_required` and `_required_default` are not cleaned up
   
   **To Reproduce**
   Steps to reproduce the behavior:
   ```
   
   
   class SchemaB(Record):
       field = String(required=True)
   
   class SchemaA(Record):
       field = SchemaB()
   
   a = SchemaA(field=SchemaB(field="something"))
   b = JsonSchema(SchemaA).encode(a)
   print(b)
   
   b'{\n "field": {\n  "_required_default": false,\n  "_default": null,\n  "_required": false,\n  "field": "something"\n }\n}'
   
   ```
   
   
   **Expected behavior**
   reserved keys are cleaned up recursively.
   
   **Desktop (please complete the following information):**
    - MacOS 12.3.1
   
   **Additional context**
   the problem seems to be [here](https://github.com/apache/pulsar/blob/master/pulsar-client-cpp/python/pulsar/schema/schema.py#L97). The cleanup is not made recursively 
   


-- 
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-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] merlimat closed issue #15844: Python Client doesn't clean up reserved field when publishing message with Schema

Posted by GitBox <gi...@apache.org>.
merlimat closed issue #15844: Python Client doesn't clean up reserved field when publishing message with Schema
URL: https://github.com/apache/pulsar/issues/15844


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] boatrainlsz commented on issue #15844: Python Client doesn't clean up reserved field when publishing message with Schema

Posted by GitBox <gi...@apache.org>.
boatrainlsz commented on issue #15844:
URL: https://github.com/apache/pulsar/issues/15844#issuecomment-1146803265

   I can fix this, I'm working on it


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org