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 2021/08/08 10:47:33 UTC

[GitHub] [pulsar] gaoran10 opened a new pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

gaoran10 opened a new pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595


   Fixes #11533
   
   ### Motivation
   
   Refer to issue #11533 , currently, if users redefined the same `Record` or `Enum` in `Record`, the schema info isn't reused the defined name, this does not match the Avro schema info format.
   
   ### Modifications
   
   Add a new method `schema_info(self, defined_names)` in `Record`, `Array`, `Map`, and `Enum`, all defined names will be added in the parameter `defined_names` when users use a defined `Record`, or `Enum`, the schema info will use the name of the defined `Record` or `Enum` as the type.
   
   ### Verifying this change
   
   Add test to verify using same `Record` or `Enum` in a complex `Record`.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
   #### For committer
   
   For this PR, do we need to update docs?
   
   - If yes,
     
     - if you update docs in this PR, label this PR with the `doc` label.
     
     - if you plan to update docs later, label this PR with the `doc-required` label.
   
     - if you need help on updating docs, create a follow-up issue with the `doc-required` label.
     
   - If no, label this PR with the `no-need-doc` label and explain why.
   
   


-- 
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] codelipenghui merged pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595


   


-- 
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] gaoran10 commented on a change in pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
gaoran10 commented on a change in pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595#discussion_r686444006



##########
File path: pulsar-client-cpp/python/pulsar/schema/definition.py
##########
@@ -393,6 +413,9 @@ def python_type(self):
         return list
 
     def validate_type(self, name, val):
+        if val is None:
+            return None

Review comment:
       Good catch, I'll fix this. Thanks




-- 
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] BewareMyPower commented on pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595#issuecomment-894906496


   > Thanks for your contribution. For this PR, do we need to update docs?
   > 
   > (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks)
   
   I added the `no-need-doc` label. It's just a bug fix.


-- 
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] HugoPelletier commented on a change in pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
HugoPelletier commented on a change in pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595#discussion_r685474487



##########
File path: pulsar-client-cpp/python/pulsar/schema/definition.py
##########
@@ -393,6 +413,9 @@ def python_type(self):
         return list
 
     def validate_type(self, name, val):
+        if val is None:
+            return None

Review comment:
       Should return the `self.default()`, not `None` automatically




-- 
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] Anonymitaet commented on pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595#issuecomment-894905476


   Thanks for your contribution. For this PR, do we need to update docs?
   
   (The [PR template contains info about doc](https://github.com/apache/pulsar/blob/master/.github/PULL_REQUEST_TEMPLATE.md#documentation), which helps others know more about the changes. Can you provide doc-related info in this and future PR descriptions? Thanks) 


-- 
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] Anonymitaet commented on pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
Anonymitaet commented on pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595#issuecomment-894906931


   @BewareMyPower thanks!


-- 
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] BewareMyPower commented on pull request #11595: [Python Schema] Fix redefined `Record` or `Enum` in Python schema

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on pull request #11595:
URL: https://github.com/apache/pulsar/pull/11595#issuecomment-894906385


   Could you rebase to master to make sure CI passed?


-- 
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