You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
The code above should run but fails with the error (i used dataclasses-avroschema==0.30.3).
Traceback (most recent call last):
File "/home/tbartsch/test/avro_issue.py", line 28, in <module>
c.serialize()
File "/home/tbartsch/test/venv/lib/python3.10/site-packages/dataclasses_avroschema/schema_generator.py", line 144, in serialize
return serialize(self.asdict(), schema, serialization_type=serialization_type)
File "/home/tbartsch/test/venv/lib/python3.10/site-packages/dataclasses_avroschema/serialization.py", line 20, in serialize
fastavro.schemaless_writer(file_like_output, schema, payload)
File "fastavro/_write.pyx", line 785, in fastavro._write.schemaless_writer
File "fastavro/_schema.pyx", line 118, in fastavro._schema.parse_schema
File "fastavro/_schema.pyx", line 257, in fastavro._schema._parse_schema
File "fastavro/_schema.pyx", line 302, in fastavro._schema.parse_field
File "fastavro/_schema.pyx", line 202, in fastavro._schema._parse_schema
File "fastavro/_schema.pyx", line 249, in fastavro._schema._parse_schema
fastavro._schema_common.SchemaParseException: redefined named type: namespace.A
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
In this case the workaround from above using alias_nested_items does not work. I was only able to fix this by using different namespaces for B and C as in this code.
Describe the bug
The avro serialization with
fastavro
for three classesA
,B
(depending onA
),C
(depending onA
andB
),fails with
even when using a namespace for
A
.To Reproduce
(EDITED: changed from using
dataclasses_avroschema.avrodantic.AvroBaseModel
todataclasses_avroschema.AvroModel
.)Expected behavior
The code above should run but fails with the error (i used
dataclasses-avroschema==0.30.3
).The text was updated successfully, but these errors were encountered: