I am able to use marshmallow_dataclass perfectly when using with dataclasses.dataclass
However, I want to use it with attrs module instead - use the converters/validators functionalities.
It works well most of the time. However, I am facing problems when I use marshmallow_dataclass + attrs with inheritance.
Scenario 2 seems to be ok for my requirements. But I am not sure what weird stuff might happen by enabling both dataclasses and attrs together. If you are aware of possible problems I might get into, please let me know.
I am able to use
marshmallow_dataclass
perfectly when using withdataclasses.dataclass
However, I want to use it with
attrs
module instead - use the converters/validators functionalities. It works well most of the time. However, I am facing problems when I usemarshmallow_dataclass
+attrs
with inheritance.Sample code is given below.
B = ClsB.Schema().load({'a': 123, 'b': 'bb', 'c': 4, 'd': "123"})
marshmallow.exceptions.ValidationError: {'a': ['Unknown field.'], 'b': ['Unknown field.']}
Questions:
dataclasses
andattrs
together. If you are aware of possible problems I might get into, please let me know.I have raised this query with
attrs
as well. https://github.com/python-attrs/attrs/issues/1114I hope the first question is answered by
marshmallow_dataclass
team and second by theattrs
team.