You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Michael A. Smith (Jira)" <ji...@apache.org> on 2019/11/17 02:57:00 UTC

[jira] [Resolved] (AVRO-2411) RecordSchema with logicalType field is not JSON serializable

     [ https://issues.apache.org/jira/browse/AVRO-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael A. Smith resolved AVRO-2411.
------------------------------------
    Resolution: Won't Fix

Closing this ticket as I don't believe there is anything else that can reasonably be done to improve this behavior unless Python upstream decides to make `json.dumps` handle mapping objects more duckily.

> RecordSchema with logicalType field is not JSON serializable
> ------------------------------------------------------------
>
>                 Key: AVRO-2411
>                 URL: https://issues.apache.org/jira/browse/AVRO-2411
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 1.9.0
>            Reporter: Jonathan
>            Assignee: Michael A. Smith
>            Priority: Major
>
> 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:
>  {code}Object of type mappingproxy is not JSON serializable{code}
> Example schema:
> {code}
> {
>   "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)"
>     }
>   ]
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)