Avro
  1. Avro
  2. AVRO-300

Support "doc" field in schemas in Python implementation

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: python
    • Labels:
      None

      Description

      AVRO-152 adds a "doc" field to Record and Enum schemas in the Java implementation. We should do the same for the Python implementation.

      1. AVRO-300-patch-1.patch
        6 kB
        Marcio Silva
      2. AVRO-300-patch-1.patch
        6 kB
        Marcio Silva

        Issue Links

          Activity

          Hide
          Harsh J added a comment -

          Btw, this one is mildly dependent on AVRO-301 in its present state. (The reserved props addition)

          Show
          Harsh J added a comment - Btw, this one is mildly dependent on AVRO-301 in its present state. (The reserved props addition)
          Hide
          Harsh J added a comment -

          +1, just went over this and the patch looks good.

          Btw, found one nit you can fix during commit:

          class Field(object):
          -  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'.

          Show
          Harsh J added a comment - +1, just went over this and the patch looks good. Btw, found one nit you can fix during commit: class Field(object): - 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'.
          Hide
          Doug Cutting added a comment -

          I'll commit this tomorrow unless there are objections.

          Show
          Doug Cutting added a comment - I'll commit this tomorrow unless there are objections.
          Hide
          Doug Cutting added a comment -

          Can someone fluent in Python please review this? Thanks!

          Show
          Doug Cutting added a comment - Can someone fluent in Python please review this? Thanks!
          Hide
          Marcio Silva added a comment -

          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.

          Show
          Marcio Silva added a comment - 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.
          Hide
          Philip Zeyliger added a comment -

          Depending on how avro records are implemented, it should be meaningful to do "foo._doc_", to give you doc information on foo.

          Show
          Philip Zeyliger added a comment - Depending on how avro records are implemented, it should be meaningful to do "foo._ doc _", to give you doc information on foo.
          Hide
          Doug Cutting added a comment -

          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?

          Show
          Doug Cutting added a comment - 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?

            People

            • Assignee:
              Marcio Silva
              Reporter:
              Jeff Hammerbacher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development