From 2e75b16403cb0ec9c7c9db6943df0b53f3779e0a Mon Sep 17 00:00:00 2001 From: QianZhu Date: Fri, 2 Feb 2024 09:02:02 -0800 Subject: [PATCH] make it explicit about the vector column data type (#916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screenshot 2024-02-01 at 4 23 34 PM [ Screenshot 2024-02-01 at 4 26 03 PM ](url) --------- Co-authored-by: Weston Pace --- docs/src/guides/tables.md | 6 ++++-- python/lancedb/table.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/guides/tables.md b/docs/src/guides/tables.md index 12510941..4692aef0 100644 --- a/docs/src/guides/tables.md +++ b/docs/src/guides/tables.md @@ -84,7 +84,7 @@ This guide will show how to create tables, insert data into them, and update the const table = await con.createTable(tableName, data, { writeMode: WriteMode.Overwrite }) ``` -### From a Pandas DataFrame + ### From a Pandas DataFrame ```python import pandas as pd @@ -100,7 +100,9 @@ This guide will show how to create tables, insert data into them, and update the db["my_table"].head() ``` !!! info "Note" - Data is converted to Arrow before being written to disk. For maximum control over how data is saved, either provide the PyArrow schema to convert to or else provide a PyArrow Table directly. + Data is converted to Arrow before being written to disk. For maximum control over how data is saved, either provide the PyArrow schema to convert to or else provide a PyArrow Table directly. + + The **`vector`** column needs to be a [Vector](../python/pydantic.md#vector-field) (defined as [pyarrow.FixedSizeList](https://arrow.apache.org/docs/python/generated/pyarrow.list_.html)) type. ```python custom_schema = pa.schema([ diff --git a/python/lancedb/table.py b/python/lancedb/table.py index 9333c424..44decda7 100644 --- a/python/lancedb/table.py +++ b/python/lancedb/table.py @@ -437,6 +437,8 @@ class Table(ABC): the table vector_column_name: str The name of the vector column to search. + + The vector column needs to be a pyarrow fixed size list type *default "vector"* query_type: str *default "auto"*.