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

Python: schemas retrieved from protocol types ignore namespace

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.4
    • Fix Version/s: 1.7.5
    • Component/s: python
    • Labels:
      None

      Description

      If I parse a protocol p using avro.protocol.parse, which defines "namespace": "ns" and then retrieve a child schema s from the protocol's proto.types (or proto.types_dict), then s does not have its namespace set (to ns), even if p has a namespace.

      This is particularly problematic if I'm using s to write out an avro file intended to be read by a specific-type reader, because the file header will claim to be objects of type s (not ns.s, as expected).

      I've attached two patches: one that makes sure that the namespace property of protocol types is set to the default namespace of the protocol when not otherwise set.

      The second patch ensures that the namespace is not rendered into JSON when a default protocol specifies the right value already.

        Attachments

        1. AVRO-1296a.patch
          2 kB
          Jeremy Kahn
        2. AVRO-1296b.patch
          3 kB
          Jeremy Kahn

          Activity

            People

            • Assignee:
              trochee Jeremy Kahn
              Reporter:
              trochee Jeremy Kahn
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: