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

Code before:

            embedding_tensor_exist = True

    if not embedding_tensor_exist:
        raise ValueError("At least one embedding tensor should exist.")

    if not ids_exist:
        raise ValueError("`id` tensor was not found in the dataset.")


def create_dataset(
    logger,
    tensor_params,
    dataset_path,
    token,
    exec_option,
    embedding_function,
    overwrite,
    runtime,
    **kwargs,
):
    if exec_option == "tensor_db" and (
        runtime is None or runtime == {"tensor_db": False}
    ):
        raise ValueError(
            "When using `exec_option = 'tensor_db'` you must specify `runtime = {'tensor_db': True}` when creating a new Vector Store."
        )

    dataset = deeplake.empty(
        dataset_path,
        token=token,
        runtime=runtime,
        verbose=False,
        overwrite=overwrite,
        **kwargs,
    )
    create_tensors(tensor_params, dataset, logger, embedding_function)

    return dataset


def create_tensors(tensor_params, dataset, logger, embedding_function):
    tensor_names = [tensor["name"] for tensor in tensor_params]
    if "id" not in tensor_names and "ids" not in tensor_names:
        tensor_params.append(
            {
                "name": "id",
                "htype": "text",
                "create_id_tensor": False,
                "create_sample_info_tensor": False,
                "create_shape_tensor": False,

Review comment (suggestion):
@adolkhan We should add an explanation of why this problem happens, not just what parameters need to be changed. Pls change this to:

To execute queries using `exec_option = 'tensor_db'`, the Vector Store must be stored in Deep Lake's Managed Tensor Database. To create the Vector Store in the Managed Tensor Database, specify `runtime = {'tensor_db': True}` when creating the Vector Store.

Code after:
                    f"`{tensor}` is not valid name for embedding tensor, as the name is preserved for another tensor"
                )

            embedding_tensor_exist = True

    if not embedding_tensor_exist:
        raise ValueError("At least one embedding tensor should exist.")

    if not ids_exist:
        raise ValueError("`id` tensor was not found in the dataset.")


def create_dataset(
    logger,
    tensor_params,
    dataset_path,
    token,
    exec_option,
    embedding_function,
    overwrite,
    runtime,
    **kwargs,
):
    if exec_option == "tensor_db" and (
        runtime is None or runtime == {"tensor_db": False}
    ):
        raise ValueError(
            "To execute queries using exec_option = 'tensor_db', "
            "the Vector Store must be stored in Deep Lake's Managed "
            "Tensor Database. To create the Vector Store in the Managed "
            "Tensor Database, specify runtime = {'tensor_db': True} when "
            "creating the Vector Store."
        )

    dataset = deeplake.empty(
        dataset_path,
        token=token,
        runtime=runtime,
        verbose=False,
        overwrite=overwrite,
        **kwargs,
    )
    create_tensors(tensor_params, dataset, logger, embedding_function)

    return dataset


def create_tensors(tensor_params, dataset, logger, embedding_function):
    tensor_names = [tensor["name"] for tensor in tensor_params]
    if "id" not in tensor_names and "ids" not in tensor_names:
        tensor_params.append(