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

Python: validation should be a method of Schema objects

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • python

    Description

      In Python, validation of a datum by the schema was done in avro.io.validate function.
      The avro.io.validate function is a complex, recursively-called switch statement.

      Instead of calling a two-argument avro.io.validate with a Schema object and a datum, it is easier to understand and extend if they are one-argument methods on the schema.

      I (Jeremy) have written a patch that implements validate methods on Schema objects. This patch will form the prerequisite for AVRO-1265 (see "easier to extend" above).

      Attachments

        1. validation-as-method-backwards-compatible.patch
          8 kB
          Jeremy Kahn
        2. validation-as-method.patch
          8 kB
          Jeremy Kahn

        Activity

          People

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

            Dates

              Created:
              Updated: