Hi, I have code for a fix, but to do a PR I need JIRA issue number. Could you open a JIRA issue for this?
See here at the last two commits for implementing a test and the fix: https://github.com/hhoeflin/avro/tree/main Thanks Holger Hoefling On Tue, Sep 24, 2024 at 3:43 PM Holger Hoefling <hhoef...@gmail.com> wrote: > Thanks, that is an idea! I don't have access to the Jira but I think it > would be worthwhile to fix. LogicalTypes should support complex types > according to the spec as i read it. At least do that it doesn't throw this > unintended error. > > Thanks for you response and thanks for avro. Am trying to use it now in > the ML space as i think it is better than a lot of the other solutions out > there. > > Best > > Holger Hoefling > > On Tue, Sep 24, 2024, 08:40 Martin Grigorov <mgrigo...@apache.org> wrote: > >> Hi Holger, >> >> >> On Mon, Sep 23, 2024 at 12:58 PM Holger Hoefling <hhoef...@gmail.com> >> wrote: >> >> > Hi >> > >> > I am trying to parse a schema of the type: >> > >> > { "type": { "type": "array", "items": "string"}, "logicalType": >> "mytype"} >> > >> > The error is: >> > >> > TypeError: Unhashable type: 'dict' >> > >> > and occurs at: >> > >> > https://github.com/apache/avro/blob/main/lang/py/avro/schema.py#L1223 >> > >> > Here, the 'type' that is a dict is checked if it is inside a key of >> another >> > dict. For that it >> > would need to be hashed, and as it is a dict, that is not possible. >> > >> > Is this a known bug? Any fixes available? >> > >> >> I am not aware of a Jira report about this problem. >> >> https://stackoverflow.com/questions/13264511/typeerror-unhashable-type-dict >> suggests some solutions. >> >> >> >> > >> > Thanks >> > >> > Holger Hoefling >> > >> >