Skip to content

Commit aa7b41d

Browse files
authored
fix(lancedb): use fixed size list for vector (#1034)
1 parent 43ba4e9 commit aa7b41d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/cocoindex/targets/lancedb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ def _convert_basic_type_to_pa_type(basic_type: BasicValueType) -> pa.DataType:
133133
raise ValueError("Vector type missing vector schema")
134134
element_type = _convert_basic_type_to_pa_type(vector_schema.element_type)
135135

136-
# Create list type with the element type
137-
return pa.list_(element_type)
136+
if vector_schema.dimension is not None:
137+
return pa.list_(element_type, vector_schema.dimension)
138+
else:
139+
return pa.list_(element_type)
138140

139141
if kind == "Range":
140142
# Range as a struct with start and end

0 commit comments

Comments
 (0)