From 1afaaa42eb3bb2f15b87e1a82b004ba79787d680 Mon Sep 17 00:00:00 2001 From: Jiangzhou He Date: Thu, 25 Sep 2025 18:58:44 -0700 Subject: [PATCH 1/2] fix: raise errors when indexing option methods are not supported --- python/cocoindex/targets/lancedb.py | 6 ++++++ src/ops/targets/kuzu.rs | 3 +++ src/ops/targets/neo4j.rs | 3 +++ src/ops/targets/qdrant.rs | 3 +++ 4 files changed, 15 insertions(+) diff --git a/python/cocoindex/targets/lancedb.py b/python/cocoindex/targets/lancedb.py index bd299d40..08bfadcb 100644 --- a/python/cocoindex/targets/lancedb.py +++ b/python/cocoindex/targets/lancedb.py @@ -296,6 +296,12 @@ def get_setup_state( ) -> _State: if len(key_fields_schema) != 1: raise ValueError("LanceDB only supports a single key field") + if index_options.vector_indexes is not None: + for vector_index in index_options.vector_indexes: + if vector_index.method is not None: + raise ValueError( + "Vector index method is not configurable for LanceDB yet" + ) return _State( key_field_schema=key_fields_schema[0], value_fields_schema=value_fields_schema, diff --git a/src/ops/targets/kuzu.rs b/src/ops/targets/kuzu.rs index 7cd9767e..3dfde5a8 100644 --- a/src/ops/targets/kuzu.rs +++ b/src/ops/targets/kuzu.rs @@ -772,6 +772,9 @@ impl TargetFactoryBase for Factory { let data_coll_outputs: Vec> = std::iter::zip(data_collections, analyzed_data_colls.into_iter()) .map(|(data_coll, analyzed)| { + if data_coll.index_options.vector_indexes.len() > 0 { + api_bail!("Vector indexes are not supported for Kuzu yet"); + } fn to_dep_table( field_mapping: &AnalyzedGraphElementFieldMapping, ) -> Result { diff --git a/src/ops/targets/neo4j.rs b/src/ops/targets/neo4j.rs index 81427046..49517dd9 100644 --- a/src/ops/targets/neo4j.rs +++ b/src/ops/targets/neo4j.rs @@ -568,6 +568,9 @@ impl SetupState { .map(|f| (f.name.as_str(), &f.value_type.typ)) .collect::>(); for index_def in index_options.vector_indexes.iter() { + if index_def.method.is_some() { + api_bail!("Vector index method is not configurable for Neo4j yet"); + } sub_components.push(ComponentState { object_label: schema.elem_type.clone(), index_def: IndexDef::from_vector_index_def( diff --git a/src/ops/targets/qdrant.rs b/src/ops/targets/qdrant.rs index 96e94300..cdb0e2f4 100644 --- a/src/ops/targets/qdrant.rs +++ b/src/ops/targets/qdrant.rs @@ -422,6 +422,9 @@ impl TargetFactoryBase for Factory { } else { api_bail!("Field `{}` specified more than once in vector index definition", vector_index.field_name); } + if vector_index.method.is_some() { + api_bail!("Vector index method is not configurable for Qdrant yet"); + } } None => { if let Some(field) = d.value_fields_schema.iter().find(|f| f.name == vector_index.field_name) { From 8f39b1d8ca0c8ff119891a5f3edcea127dad6e85 Mon Sep 17 00:00:00 2001 From: Jiangzhou Date: Thu, 25 Sep 2025 19:05:17 -0700 Subject: [PATCH 2/2] Update src/ops/targets/kuzu.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/ops/targets/kuzu.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ops/targets/kuzu.rs b/src/ops/targets/kuzu.rs index 3dfde5a8..d6b0bbc1 100644 --- a/src/ops/targets/kuzu.rs +++ b/src/ops/targets/kuzu.rs @@ -772,7 +772,7 @@ impl TargetFactoryBase for Factory { let data_coll_outputs: Vec> = std::iter::zip(data_collections, analyzed_data_colls.into_iter()) .map(|(data_coll, analyzed)| { - if data_coll.index_options.vector_indexes.len() > 0 { + if !data_coll.index_options.vector_indexes.is_empty() { api_bail!("Vector indexes are not supported for Kuzu yet"); } fn to_dep_table(