Repository: activeloopai/Hub
File: deeplake/core/vectorstore/deeplake_vectorstore.py (Python)

Code before:

        utils.parse_search_args(
            embedding_data=embedding_data,
            embedding_function=embedding_function,
            initial_embedding_function=self.embedding_function,
            embedding=embedding,
            k=k,
            distance_metric=distance_metric,
            query=query,
            filter=filter,
            exec_option=exec_option,
            embedding_tensor=embedding_tensor,
            return_tensors=return_tensors,
        )

        query_emb: Optional[Union[List[float], np.ndarray[Any, Any]]] = None
        if query is None:
            query_emb = dataset_utils.get_embedding(
                embedding,
                embedding_data,
                embedding_function=embedding_function or self.embedding_function,
            )
            if isinstance(query_emb, np.ndarray):
                assert (
                    query_emb.ndim == 1 or query_emb.shape[0] == 1
                ), "Query embedding must be 1-dimensional"

        if not return_tensors:
            return_tensors = [
                tensor for tensor in self.dataset.tensors if tensor != embedding_tensor
            ]

        return vector_search.search(
            query=query,
            logger=logger,
            filter=filter,
            query_embedding=query_emb,
            k=k,
            distance_metric=distance_metric,
            exec_option=exec_option,
            deeplake_dataset=self.dataset,
            embedding_tensor=embedding_tensor,
            return_tensors=return_tensors,
            return_view=return_view,
        )

    def delete(
        self,
        row_ids: Optional[List[str]] = None,
        ids: Optional[List[str]] = None,
        filter: Optional[Union[Dict, Callable]] = None,

Review comment (suggestion):
I would add here , use another embedding fucntion
```suggestion
                ), "Query embedding must be 1-dimensional. Please consider using another embedding function for converting query string to embedding"
```

Code after:

        utils.parse_search_args(
            embedding_data=embedding_data,
            embedding_function=embedding_function,
            initial_embedding_function=self.embedding_function,
            embedding=embedding,
            k=k,
            distance_metric=distance_metric,
            query=query,
            filter=filter,
            exec_option=exec_option,
            embedding_tensor=embedding_tensor,
            return_tensors=return_tensors,
        )

        query_emb: Optional[Union[List[float], np.ndarray[Any, Any]]] = None
        if query is None:
            query_emb = dataset_utils.get_embedding(
                embedding,
                embedding_data,
                embedding_function=embedding_function or self.embedding_function,
            )
            if isinstance(query_emb, np.ndarray):
                assert (
                    query_emb.ndim == 1 or query_emb.shape[0] == 1
                ), "Query embedding must be 1-dimensional. Please consider using another embedding function for converting query string to embedding."

        if not return_tensors:
            return_tensors = [
                tensor for tensor in self.dataset.tensors if tensor != embedding_tensor
            ]

        return vector_search.search(
            query=query,
            logger=logger,
            filter=filter,
            query_embedding=query_emb,
            k=k,
            distance_metric=distance_metric,
            exec_option=exec_option,
            deeplake_dataset=self.dataset,
            embedding_tensor=embedding_tensor,
            return_tensors=return_tensors,
            return_view=return_view,
        )

    def delete(
        self,
        row_ids: Optional[List[str]] = None,
        ids: Optional[List[str]] = None,
        filter: Optional[Union[Dict, Callable]] = None,