diff --git a/tensorbay/label/label_mask.py b/tensorbay/label/label_mask.py index f1458ff52..2eeab876f 100644 --- a/tensorbay/label/label_mask.py +++ b/tensorbay/label/label_mask.py @@ -355,7 +355,20 @@ def get_callback_body(self) -> Dict[str, Any]: return body -class RemoteSemanticMask(SemanticMaskBase, RemoteFileMixin): +class RemoteMaskErrorMixin: # pylint: disable=too-few-public-methods + """RemoteMaskErrorMixin provid more accurate error information when calling ``dumps()``.""" + + def get_callback_body(self) -> None: + """``dumps`` function is not support for remote mask label. + + Raises: + AttributeError: when calling the ``dumps()``. + + """ + raise AttributeError(f"'{self.__class__.__name__}' object has no function 'dumps()'") + + +class RemoteSemanticMask(SemanticMaskBase, RemoteFileMixin, RemoteMaskErrorMixin): """RemoteSemanticMask is a class for the remote semantic mask label. Attributes: @@ -403,7 +416,7 @@ def from_response_body(cls: Type[_T], body: Dict[str, Any]) -> _T: return mask -class RemoteInstanceMask(InstanceMaskBase, RemoteFileMixin): +class RemoteInstanceMask(InstanceMaskBase, RemoteFileMixin, RemoteMaskErrorMixin): """RemoteInstanceMask is a class for the remote instance mask label. Attributes: @@ -451,7 +464,7 @@ def from_response_body(cls: Type[_T], body: Dict[str, Any]) -> _T: return mask -class RemotePanopticMask(PanopticMaskBase, RemoteFileMixin): +class RemotePanopticMask(PanopticMaskBase, RemoteFileMixin, RemoteMaskErrorMixin): """RemotePanoticMask is a class for the remote panotic mask label. Attributes: