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

          Jeff Hammerbacher created issue -
          Jeff Hammerbacher made changes -
          Field Original Value New Value
          Link This issue is related to AVRO-152 [ AVRO-152 ]
          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?
          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.
          Jeff Hammerbacher made changes -
          Link This issue is related to AVRO-283 [ AVRO-283 ]
          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.
          Marcio Silva made changes -
          Attachment AVRO-300-patch-1.patch [ 12513232 ]
          Attachment AVRO-300-patch-1.patch [ 12513233 ]
          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!
          Doug Cutting made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Assignee Jeff Hammerbacher [ hammer ] Marcio Silva [ marciosilva ]
          Fix Version/s 1.6.2 [ 12319074 ]
          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
          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
          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)
          Doug Cutting made changes -
          Fix Version/s 1.7.0 [ 12318848 ]
          Fix Version/s 1.6.2 [ 12319074 ]
          Miki Tebeka made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Doug Cutting made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development