Fix dataclass mypy error

This commit is contained in:
Harshal Sheth 2021-02-10 00:11:40 -08:00 committed by Shirshanka Das
parent eaac303610
commit 1e06bda07c

View File

@ -9,11 +9,14 @@ class RecordEnvelope(Generic[T]):
record: T
metadata: dict
@dataclass
class WorkUnit(metaclass=ABCMeta):
class _WorkUnitId(metaclass=ABCMeta):
id: str
# For information on why the WorkUnit class is structured this way
# and is separating the dataclass portion from the abstract methods, see
# https://github.com/python/mypy/issues/5374#issuecomment-568335302.
class WorkUnit(_WorkUnitId, metaclass=ABCMeta):
@abstractmethod
def get_metadata(self) -> dict:
pass