Repository: jina-ai/jina
File: jina/types/request/data.py (Python)

Code before:
            if isinstance(request, jina_pb2.DataRequestProto):
                self._pb_body = request
            elif isinstance(request, dict):
                self._pb_body = jina_pb2.DataRequestProto()
                json_format.ParseDict(request, self._pb_body)
            elif isinstance(request, str):
                self._pb_body = jina_pb2.DataRequestProto()
                json_format.Parse(request, self._pb_body)
            elif isinstance(request, bytes):
                self.buffer = request
            elif request is not None:
                # note ``None`` is not considered as a bad type
                raise ValueError(f'{typename(request)} is not recognizable')
            else:
                self._pb_body = jina_pb2.DataRequestProto()
                self._pb_body.header.request_id = random_identity()
        except Exception as ex:
            raise BadRequestType(
                f'fail to construct a {self.__class__} object from {request}'
            ) from ex

    @property
    def is_decompressed(self) -> bool:
        """
        Checks if the underlying proto object was already deserialized into a :class:`jina.proto.jina_pb2.DataRequestProto` or
        :class:`jina.proto.jina_pb2.DataRequestProtoWoData` This does not necessarily mean that the docs are loaded.
           :return: True if the proto was deserialized before
        """
        return type(self._pb_body) in [
            jina_pb2.DataRequestProto,
            jina_pb2.DataRequestProtoWoData,
        ]

    @property
    def is_decompressed_with_data(self) -> bool:
        """
        Checks if the underlying proto object was already deserialized into a :class:`jina.proto.jina_pb2.DataRequestProto`. In this case the full proto is loaded including tha data ( docs )
           :return: True if the proto was deserialized before
        """
        return type(self._pb_body) is jina_pb2.DataRequestProto

    @property
    def is_decompressed_wo_data(self) -> bool:
        """
        Checks if the underlying proto object was already deserialized into a :class:`jina.proto.jina_pb2.DataRequestProtoWoData`. It means that the proto is loaded without the data ( docs ).

        :return: True if the proto was deserialized before into a DataRequest without docs
        """
        return type(self._pb_body) is jina_pb2.DataRequestProtoWoData

    @property

Review comment (suggestion):
```suggestion
        :class:`jina.proto.jina_pb2.DataRequestProtoWoData`. This does not necessarily mean that the data (docs) inside the request is also decompressed.
```

Code after:
            if isinstance(request, jina_pb2.DataRequestProto):
                self._pb_body = request
            elif isinstance(request, dict):
                self._pb_body = jina_pb2.DataRequestProto()
                json_format.ParseDict(request, self._pb_body)
            elif isinstance(request, str):
                self._pb_body = jina_pb2.DataRequestProto()
                json_format.Parse(request, self._pb_body)
            elif isinstance(request, bytes):
                self.buffer = request
            elif request is not None:
                # note ``None`` is not considered as a bad type
                raise ValueError(f'{typename(request)} is not recognizable')
            else:
                self._pb_body = jina_pb2.DataRequestProto()
                self._pb_body.header.request_id = random_identity()
        except Exception as ex:
            raise BadRequestType(
                f'fail to construct a {self.__class__} object from {request}'
            ) from ex

    @property
    def is_decompressed(self) -> bool:
        """
        Checks if the underlying proto object was already deserialized into a :class:`jina.proto.jina_pb2.DataRequestProto` or
        :class:`jina.proto.jina_pb2.DataRequestProtoWoData`. This does not necessarily mean that the data (docs) inside the request is also decompressed.
           :return: True if the proto was deserialized before
        """
        return type(self._pb_body) in [
            jina_pb2.DataRequestProto,
            jina_pb2.DataRequestProtoWoData,
        ]

    @property
    def is_decompressed_with_data(self) -> bool:
        """
        Checks if the underlying proto object was already deserialized into a :class:`jina.proto.jina_pb2.DataRequestProto`. In this case the full proto is decompressed, including the data (docs).
           :return: True if the proto was deserialized before, including the data (docs)
        """
        return type(self._pb_body) is jina_pb2.DataRequestProto

    @property
    def is_decompressed_wo_data(self) -> bool:
        """
        Checks if the underlying proto object was already deserialized into a :class:`jina.proto.jina_pb2.DataRequestProtoWoData`. It means that the proto is loaded without the data ( docs ).

        :return: True if the proto was deserialized before into a DataRequest without docs
        """
        return type(self._pb_body) is jina_pb2.DataRequestProtoWoData

    @property