We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug There seems to be a bug in AvroModel.serialize() with Enums if they are used in the following structure:
AvroModel.serialize()
class AvroModel1: foo: Enum class AvroModel2: bar: list[AvroModel1]
To Reproduce
pip install dataclasses-avroschema==0.32.1
import enum from dataclasses_avroschema import AvroModel from dataclasses import dataclass class FavoriteColor(enum.Enum): BLUE = "BLUE" YELLOW = "YELLOW" GREEN = "GREEN" @dataclass class UserModel(AvroModel): color: FavoriteColor = FavoriteColor.BLUE @dataclass class GroupModel(AvroModel): users: list[UserModel] user = UserModel() group = GroupModel([user]) group.serialize()
raises ValueError: <FavoriteColor.BLUE: 'BLUE'> is not in list
ValueError: <FavoriteColor.BLUE: 'BLUE'> is not in list
The text was updated successfully, but these errors were encountered:
fix: nested enums serialization. Closes #208
22f7875
14f39ce
7770d5d
No branches or pull requests
Describe the bug
There seems to be a bug in
AvroModel.serialize()
with Enums if they are used in the following structure:To Reproduce
pip install dataclasses-avroschema==0.32.1
raises
ValueError: <FavoriteColor.BLUE: 'BLUE'> is not in list
The text was updated successfully, but these errors were encountered: