Open gryznar opened 1 year ago
Describe the bug
dict is not matched if its keys are enums
To Reproduce
from enum import Enum from dacite import Config, from_dict class Bar(Enum): BAR_1 = 1 BAR_2 = 2 @dataclass class Foo: d: dict[Bar, str] from_dict(Foo, {'d': {1: "1"}}, config=Config(cast=[Enum]))
Expected behavior
dataclass is created
Actual behavior
dacite.exceptions.WrongTypeError: wrong value type for field "d" - should be "dict" instead of value "{1: '1'}" of type "dict"
Environment
dacite
Is there a workaround for this?
Facing similar issues. Was hoping to get this fixed if possible
@ali-raza-zaidi I had a similar issue, and ended up switching to msgspec to solve it.
Describe the bug
dict is not matched if its keys are enums
To Reproduce
Expected behavior
dataclass is created
Actual behavior
dacite.exceptions.WrongTypeError: wrong value type for field "d" - should be "dict" instead of value "{1: '1'}" of type "dict"
Environment
dacite
version: 1.8.1