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 2019/05/13 22:09:25 UTC

[GitHub] [pulsar] moonboots300 edited a comment on issue #4271: Pulsar Avro Schema Enum improvement request

moonboots300 edited a comment on issue #4271: Pulsar Avro Schema Enum improvement request
URL: https://github.com/apache/pulsar/issues/4271#issuecomment-492005296
 
 
   so for #2. (java) I found that setting .withAlwaysAllowNull(false) and marking fields as @Nullable (org.apache.avro.reflect.Nullable) as a workaround works. Still not perfect, but slightly better than originally mentioned. 
   
   > How do you suggest the declaration for enums with "annotations" should look like in Python?
   
   I suggest that there be a similar method to mark an Enum as required. It should look like this when I define a class that extends Record (to create a schema). I am not as familiar with Python Enums, so I may be missing something. I suppose there is some rule that prevents passing "required=True" to an enum like below?
   
   ```
   class MyObject(Record):
         a = String()
         b = Integer(required=True)
         c = **MyEnum(required=True)**
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services