lovasoa / marshmallow_dataclass

Automatic generation of marshmallow schemas from dataclasses.
https://lovasoa.github.io/marshmallow_dataclass/html/marshmallow_dataclass.html
MIT License
458 stars 78 forks source link

Inheritance w/ `Schema: ClassVar[Type[Schema]]` is broken as of 8.5.6 #192

Open ghost opened 2 years ago

ghost commented 2 years ago

PR #189 introduced a regression where inheritance between dataclasses w/ explicit ClassVar[Type[Schema]]'s in parents is broken. The WAR from the PR was to drop it off of parents, but it'd be nice to see it fixed for those of us that love type-checking and hinting.

From that PR's comment chain:

@dataclass
class ThingA:
    Schema: ClassVar[Type[Schema]]
    name: str

@dataclass
class ThingB(ThingA):
    Schema: ClassVar[Type[Schema]]
    short_name: str