1. Avro
  2. AVRO-1265

Python: schema objects should support builder() default-filling behavior


    • Type: Improvement Improvement
    • Status: Patch Available
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: python
    • Labels:


      There seems to be no way to easily use the avro libraries in Python (where I feel most qualified to comment) to encode generics with "missing default values" and have them transmitted in well-formed avro binary.

      If you fill in the "missing" default values, the Python libraries will transmit correctly.

      I'd be happy to add methods to the avro.RecordSchema objects (in the Python libraries) that "fill defaults" on missing member fields of a record, recursively (which probably means method extension of other schema classes as well).

      For backwards compatibility (and probably to avoid unnecessary data traversal), clients probably want to explicitly ask the schema to fill in defaults before transmission in the cases where you'd like to set only the non-default values.

      1. avro-1265b-tests.patch
        2 kB
        Jeremy Kahn
      2. avro-1265a-build-defaults.patch
        3 kB
        Jeremy Kahn


        Jeremy Kahn created issue -
        Jeremy Kahn made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Jeremy Kahn made changes -
        Attachment avro-1265a-build-defaults.patch [ 12576237 ]
        Attachment avro-1265b-tests.patch [ 12576238 ]
        Jeremy Kahn made changes -
        Status In Progress [ 3 ] Patch Available [ 10002 ]
        Doug Cutting made changes -
        Fix Version/s 1.8.0 [ 12323299 ]
        Fix Version/s 1.7.5 [ 12324096 ]


          • Assignee:
            Jeremy Kahn
            Jeremy Kahn
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: