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

Code before:
           :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` i,e
        a DataRequest without docs

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

    @property
    def proto_wo_data(
        self,
    ) -> Union['jina_pb2.DataRequestProtoWoData', 'jina_pb2.DataRequestProto']:
        """
        Transform the current buffer to a :class:`jina_pb2.DataRequestProtoWoData` unless the full proto has already
        been initialized or . Laziness will be broken and serialization will be recomputed when
        calling :meth:`SerializeToString`.
        :return: protobuf instance containing parameters
        """
        if self._pb_body is None:
            self._decompress_wo_data()
        return self._pb_body

    @property
    def proto(
        self,
    ) -> Union['jina_pb2.DataRequestProto', 'jina_pb2.DataRequestProtoWoData']:
        """
        Cast ``self`` to a :class:`jina_pb2.DataRequestProto`. Laziness will be broken and serialization will be recomputed when calling.
        :meth:`SerializeToString`.
        :return: DataRequestProto protobuf instance
        """
        if not self.is_decompressed:
            self._decompress()
        return self._pb_body

    @property
    def proto_with_data(
        self,
    ) -> 'jina_pb2.DataRequestProto':
        """
        Cast ``self`` to a :class:`jina_pb2.DataRequestProto`. Laziness will be broken and serialization will be recomputed when calling.
        :meth:`SerializeToString`.
        :return: DataRequestProto protobuf instance
        """
        if not self.is_decompressed_with_data:

Review comment (suggestion):
If `self._pb_body` is a proto *with* data (so not `None`), this will return a proto with data, right? That would be unexpected for me.

Code after:
           :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
    def proto_wo_data(
        self,
    ) -> Union['jina_pb2.DataRequestProtoWoData', 'jina_pb2.DataRequestProto']:
        """
        Transform the current buffer to a :class:`jina_pb2.DataRequestProtoWoData` unless the full proto has already
        been initialized or . Laziness will be broken and serialization will be recomputed when
        calling :meth:`SerializeToString`.
        :return: protobuf instance containing parameters
        """
        if self._pb_body is None:
            self._decompress_wo_data()
        return self._pb_body

    @property
    def proto(
        self,
    ) -> Union['jina_pb2.DataRequestProto', 'jina_pb2.DataRequestProtoWoData']:
        """
        Cast ``self`` to a :class:`jina_pb2.DataRequestProto` or a :class:`jina_pb2.DataRequestProto`. Laziness will be broken and serialization will be recomputed when calling.
        it returns the underlying proto if it already exists (even if he is loaded without data) or creates a new one.
        :meth:`SerializeToString`.
        :return: DataRequestProto protobuf instance
        """
        if not self.is_decompressed:
            self._decompress()
        return self._pb_body

    @property
    def proto_with_data(
        self,
    ) -> 'jina_pb2.DataRequestProto':
        """
        Cast ``self`` to a :class:`jina_pb2.DataRequestProto`. Laziness will be broken and serialization will be recomputed when calling.
        :meth:`SerializeToString`.
        :return: DataRequestProto protobuf instance
        """
        if not self.is_decompressed_with_data: