website api doc rework

This commit is contained in:
qzhu
2024-01-25 16:16:50 -08:00
parent 5228ca4b6b
commit 7a5e65d437
33 changed files with 1042 additions and 197 deletions

View File

@@ -87,16 +87,25 @@ class DBConnection(EnforceOverrides):
Can be either "create" or "overwrite".
By default, if the table already exists, an exception is raised.
If you want to overwrite the table, use mode="overwrite".
**Note: this parameter is not yet supported on LanceDB Cloud**
exist_ok: bool, default False
If a table by the same name already exists, then raise an exception
if exist_ok=False. If exist_ok=True, then open the existing table;
it will not add the provided data but will validate against any
schema that's specified.
**Note: this parameter is not yet supported on LanceDB Cloud**
on_bad_vectors: str, default "error"
What to do if any of the vectors are not the same size or contains NaNs.
One of "error", "drop", "fill".
fill_value: float
The value to use when filling vectors. Only used if on_bad_vectors="fill".
embedding_functions: List[EmbeddingFunctionConfig], default None
The embedding functions to be applied before inserting data to
LanceDB table.
**Note: this parameter is not yet supported on LanceDB Cloud**
Returns
-------
@@ -230,7 +239,9 @@ class DBConnection(EnforceOverrides):
def drop_database(self):
"""
Drop database
This is the same thing as dropping all the tables
This functions the same as dropping all the tables
**Note: this API is not yet available on LanceDB Cloud**
"""
raise NotImplementedError

View File

@@ -54,16 +54,16 @@ class RemoteTable(Table):
def to_arrow(self) -> pa.Table:
"""to_arrow() is not supported on the LanceDB cloud"""
raise NotImplementedError("to_arrow() is not supported on the LanceDB cloud")
raise NotImplementedError("to_arrow() is not yet supported on LanceDB Cloud")
def to_pandas(self):
"""to_pandas() is not supported on the LanceDB cloud"""
return NotImplementedError("to_pandas() is not supported on the LanceDB cloud")
return NotImplementedError("to_pandas() is not yet supported on LanceDB Cloud")
def create_scalar_index(self, *args, **kwargs):
"""Creates a scalar index"""
return NotImplementedError(
"create_scalar_index() is not supported on the LanceDB cloud"
"create_scalar_index() is not yet supported on LanceDB Cloud"
)
def create_index(

View File

@@ -178,6 +178,7 @@ class Table(ABC):
def to_pandas(self) -> "pd.DataFrame":
"""Return the table as a pandas DataFrame.
**Note: this API is not yet available on LanceDB Cloud**
Returns
-------
pd.DataFrame
@@ -188,6 +189,7 @@ class Table(ABC):
def to_arrow(self) -> pa.Table:
"""Return the table as a pyarrow Table.
**Note: this API is not yet available on LanceDB Cloud**
Returns
-------
pa.Table
@@ -215,18 +217,26 @@ class Table(ABC):
num_partitions: int, default 256
The number of IVF partitions to use when creating the index.
Default is 256.
**Note: this parameter is not supported on LanceDB Cloud**
num_sub_vectors: int, default 96
The number of PQ sub-vectors to use when creating the index.
Default is 96.
**Note: this parameter is not supported on LanceDB Cloud**
vector_column_name: str, default "vector"
The vector column name to create the index.
replace: bool, default True
- If True, replace the existing index if it exists.
- If False, raise an error if duplicate index exists.
**Note: this parameter is not yet supported on LanceDB Cloud**
accelerator: str, default None
If set, use the given accelerator to create the index.
Only support "cuda" for now.
**Note: this parameter is not yet supported on LanceDB Cloud**
index_cache_size : int, optional
The size of the index cache in number of entries. Default value is 256.
"""
@@ -241,6 +251,8 @@ class Table(ABC):
):
"""Create a scalar index on a column.
**Note: this API is not yet available on LanceDB Cloud**
Scalar indices, like vector indices, can be used to speed up scans. A scalar
index can speed up scans that contain filter expressions on the indexed column.
For example, the following scan will be faster if the column ``my_col`` has
@@ -396,6 +408,8 @@ class Table(ABC):
- If `query` is a string, then the query type is "vector" if the
table has embedding functions else the query type is "fts"
**Note: this parameter is not yet supported on LanceDB Cloud**
Returns
-------
LanceQueryBuilder