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
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?
Depending on how avro records are implemented, it should be meaningful to do "foo._doc_", to give you doc information on foo.
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.
Can someone fluent in Python please review this? Thanks!
I'll commit this tomorrow unless there are objections.
+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'.
Btw, this one is mildly dependent on AVRO-301 in its present state. (The reserved props addition)