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

RecordSchema with logicalType field is not JSON serializable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.9.0
    • None
    • python
    • None

    Description

      After updating to 1.9.0, RecordSchemas that contain a field with a logicalType mapping can no longer be passed into json.dumps() as it throws the following error:

       

      Object of type mappingproxy is not JSON serializable

      Example schema:

      {
        "namespace": "Sherlock",
        "type": "record",
        "name": "Action",
        "fields": [
          {
            "name": "action_id",
            "type": "string",
            "doc": "Key for the Action"
          },
          {
            "name": "actionType_id",
            "type": "int",
            "doc": "Action Type key"
          },
          {
            "name": "timestamp",
            "type": {
              "type": "long",
              "logicalType": "timestamp-millis"
            },
            "doc": "Event time of validation request or modified_dt of save (UTC)"
          }
        ]
      }
      

      Attachments

        Activity

          People

            kojiromike Michael A. Smith
            jhabshoosh Jonathan
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: