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
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
The text was updated successfully, but these errors were encountered:
Is there a workaround for this?
Sorry, something went wrong.
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.
No branches or pull requests
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.1The text was updated successfully, but these errors were encountered: