mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-02 05:33:57 +00:00
Fix dataclass mypy error
This commit is contained in:
parent
eaac303610
commit
1e06bda07c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user