Closed pj-sp closed 2 weeks ago
Hi @pj-sp ,
occurredAt
is the correct one (datetime.datetime
). You as python developer work with the object and then when the data is serialized
then it is translates into long
. Take a look the documentationcustom logical types
, they are not supported. Your suggestion to do the fallback is what should happen.I will try to add the fallback
.
@marcosschroh great, thx for the info
From Avro docs:
Language implementations must ignore unknown logical types when reading, and should use the underlying Avro type. If a logical type is invalid, for example a decimal with scale greater than its precision, then implementations should ignore the logical type and use the underlying Avro type.
Is your feature request related to a problem? Please describe. I have a case where I'd like to use
ModelGenerator
to generate model from avro schema, however I noticed some issues. Let's say that I have schema defined as below:Model generation fails with an exception
I did another test (same schema, without
url
) and generated model isSo,
occurredAt
is defined as datetime (I'm expecting integer here, as field is defined astimestamp-millis
->long
.Describe the solution you'd like Are there any plans to allow:
type
for custom logical types, instead of raising an errortimestamp-millis
type?