Avro
  1. Avro
  2. AVRO-850

Python protocol parsing doesn't set message error union to ['string'] when no errors declared

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.0
    • Fix Version/s: None
    • Component/s: python
    • Labels:
      None

      Description

      This bug applies to the python module.

      According to the protocol specification (http://avro.apache.org/docs/current/spec.html#Messages) when no errors are declared in the protocol for a message, the effective error union is ['string']. The behavior of avro.protocol is not consistent with this specification. In particular if no errors are declared the "errors" property of Message will be None and not an instance of ErrorUnionSchema. Consequently, if a message returns an error an exception gets thrown.

      Patch to follow shortly.

      1. AVRO-850.patch
        2 kB
        Jeremy Lewi

        Activity

        Hide
        Jeremy Lewi added a comment -

        Here is a patch. In addition to fixing the issue, I added a test case to test_protocol to ensure that when no errors are declared, errors is ['string']

        Show
        Jeremy Lewi added a comment - Here is a patch. In addition to fixing the issue, I added a test case to test_protocol to ensure that when no errors are declared, errors is ['string']
        Hide
        Douglas Kaminsky added a comment -

        This is a duplicate of AVRO-748 as far as I can tell

        Show
        Douglas Kaminsky added a comment - This is a duplicate of AVRO-748 as far as I can tell
        Hide
        Doug Cutting added a comment -

        > This is a duplicate of AVRO-748 as far as I can tell

        Yes, but this one has a patch!

        I'll commit this tomorrow unless there are objections.

        Show
        Doug Cutting added a comment - > This is a duplicate of AVRO-748 as far as I can tell Yes, but this one has a patch! I'll commit this tomorrow unless there are objections.

          People

          • Assignee:
            Jeremy Lewi
            Reporter:
            Jeremy Lewi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development