AVRO-152 adds a "doc" field to Record and Enum schemas in the Java implementation. We should do the same for the Python implementation.
Adding "doc" to record schemas, a la javadoc field and class comments.
Change the new Python implementation from dictionaries to objects
Btw, this one is mildly dependent on AVRO-301 in its present state. (The reserved props addition)
+1, just went over this and the patch looks good.
Btw, found one nit you can fix during commit:
- def __init__(self, type, name, has_default, default=None, order=None, names=None):
+ def __init__(self, type, name, has_default, default=None, order=None,names=None, doc=None):
There is a missing space before 'names'.
I'll commit this tomorrow unless there are objections.
Can someone fluent in Python please review this? Thanks!
This patch adds the doc property to Fields, Records, and Enums. It includes an additional unit test that verifies that the fields are present in parsed schemas.
Depending on how avro records are implemented, it should be meaningful to do "foo._doc_", to give you doc information on foo.
What would doc support in Python do? In Java its important since it adds javadoc to generated code. And we should pass comments through from genavro to generated code via the schema (AVRO-296). But since Python doesn't generate code, how would documentation be used?