Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1289

Python: Schema objects should polymorphically interact with data-walker interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.7.5
    • None
    • python

    Description

      Python avro.schema objects should be able to call back to a general data-and-schema parallel-walker ("validate" would be one of those, but so could be "default-filler").

      There should be an avro.walker interface that owns the parallel state (a datum-reader/deserializer, a datum-writer/serializer, a validator, or a default-filler – see AVRO-1265). Schema polymorphism would allow us to eliminate the large (and highly redundant) function-dispatch methods in avro.io by making the avro.schema.Schema subclass responsible for calling back to the avro.walker object.

      Assigning this to v1.8.0 because it may be difficult to duplicate every behavior of 1.7.* with the same function signatures, especially where this refactor may be eliminate entire classes.

      This factoring ought to make it easier to improve or extend objects that meet this walker interface – validators & serializers might be able to store more state about their position within a record, for example, to yield more informative error messages upon mismatch (as requested by Jonathan Coveney on the user mailing list).

      Attachments

        Activity

          People

            trochee Jeremy Kahn
            trochee Jeremy Kahn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: