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/06/14 09:20:01 UTC

[GitHub] [pulsar] Choqs opened a new issue, #16056: [Bug][Python Client] _check_record_or_field exception throw another exception

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

   ### Describe the bug
   
   Using python pulsar-client, instantiating a schema with an array of a wrong type, leads exception to throw another exception. This make it harder to debug and understand what is wrong for the user.
   
   ### How to reproduce
   
   ```python
   from pulsar.schema import Integer, Array, Record
   
   
   class SomeSchema(Record):
       some_field = Array(Integer(), required=False, default=[])
   
   
   # All good
   some_schema = SomeSchema()
   
   # Still all good
   some_schema = SomeSchema(some_field=[1, 2, 3])
   
   # Exception not super descriptive
   some_schema = SomeSchema(some_field=["not", "integer"])
   ``` 
   
   This script will give the below traceback :
   
   ```
   ...
       raise TypeError('Array field ' + name + ' items should all be of type '
   TypeError: can only concatenate str (not "type") to str
   ```
   
   Instead of :
   
   ```
       raise TypeError('Array field ' + name + ' items should all be of type '
   TypeError: Array field some_schema items should all be of type Integer
   ```
   
   ### Environment
   
   - pulsar-client==2.8.0


-- 
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] boatrainlsz commented on issue #16056: [Bug][Python Client] _check_record_or_field exception throw another exception

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

   I'm woking 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


[GitHub] [pulsar] BewareMyPower closed issue #16056: [Bug][Python Client] _check_record_or_field exception throw another exception

Posted by GitBox <gi...@apache.org>.
BewareMyPower closed issue #16056: [Bug][Python Client] _check_record_or_field exception throw another exception
URL: https://github.com/apache/pulsar/issues/16056


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