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

Test scale validation when encoding decimal logical schema

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.10.2
    • Fix Version/s: 1.11.0
    • Component/s: python
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: