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

Test scale validation when encoding decimal logical schema

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.10.2
    • 1.11.0
    • python
    • None

    Description

      Based on a CodeQL finding, it seems decimal logical types are probably broken and need testing with various encoding and decoding steps. I think:

      1. Python decimal exponents are always negative, and avro schema scales are always positive, so the if exp > scale: raise check does not raise an exception.
      2. If it did, it would raise the wrong exception, because it would fail to instantiate the exception class.

      Attachments

        Activity

          People

            kojiromike Michael A. Smith
            kojiromike Michael A. Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: