Skip to content

Commit 685b76e

Browse files
georgeh0Copilot
andauthored
fix: raise errors when indexing option methods are not supported (#1056)
* fix: raise errors when indexing option methods are not supported * Update src/ops/targets/kuzu.rs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent c65d1e5 commit 685b76e

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

python/cocoindex/targets/lancedb.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ def get_setup_state(
296296
) -> _State:
297297
if len(key_fields_schema) != 1:
298298
raise ValueError("LanceDB only supports a single key field")
299+
if index_options.vector_indexes is not None:
300+
for vector_index in index_options.vector_indexes:
301+
if vector_index.method is not None:
302+
raise ValueError(
303+
"Vector index method is not configurable for LanceDB yet"
304+
)
299305
return _State(
300306
key_field_schema=key_fields_schema[0],
301307
value_fields_schema=value_fields_schema,

src/ops/targets/kuzu.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,9 @@ impl TargetFactoryBase for Factory {
772772
let data_coll_outputs: Vec<TypedExportDataCollectionBuildOutput<Self>> =
773773
std::iter::zip(data_collections, analyzed_data_colls.into_iter())
774774
.map(|(data_coll, analyzed)| {
775+
if !data_coll.index_options.vector_indexes.is_empty() {
776+
api_bail!("Vector indexes are not supported for Kuzu yet");
777+
}
775778
fn to_dep_table(
776779
field_mapping: &AnalyzedGraphElementFieldMapping,
777780
) -> Result<ReferencedNodeTable> {

src/ops/targets/neo4j.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ impl SetupState {
568568
.map(|f| (f.name.as_str(), &f.value_type.typ))
569569
.collect::<HashMap<_, _>>();
570570
for index_def in index_options.vector_indexes.iter() {
571+
if index_def.method.is_some() {
572+
api_bail!("Vector index method is not configurable for Neo4j yet");
573+
}
571574
sub_components.push(ComponentState {
572575
object_label: schema.elem_type.clone(),
573576
index_def: IndexDef::from_vector_index_def(

src/ops/targets/qdrant.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ impl TargetFactoryBase for Factory {
422422
} else {
423423
api_bail!("Field `{}` specified more than once in vector index definition", vector_index.field_name);
424424
}
425+
if vector_index.method.is_some() {
426+
api_bail!("Vector index method is not configurable for Qdrant yet");
427+
}
425428
}
426429
None => {
427430
if let Some(field) = d.value_fields_schema.iter().find(|f| f.name == vector_index.field_name) {

0 commit comments

Comments
 (0)