File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 3535 uses : Swatinem/rust-cache@v2
3636 with :
3737 key : rust-${{ matrix.platform.runner }}-${{ matrix.python-version }}
38+ - name : Rust tests (no default features)
39+ run : cargo test --no-default-features --verbose
40+
3841 - name : Rust tests
3942 run : cargo test --verbose
4043
8184 if [ $status -ne 0 ]; then
8285 echo "::error::Third-party notices validation failed. Please update /about.toml and rerun."
8386 exit $status
84- fi
87+ fi
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ lto = true
1515name = " cocoindex_engine"
1616crate-type = [" cdylib" ]
1717
18+ [features ]
19+ default = [" legacy-states-v0" ]
20+ legacy-states-v0 = []
21+
1822[dependencies ]
1923pyo3 = { version = " 0.25.1" , features = [
2024 " abi3-py311" ,
Original file line number Diff line number Diff line change @@ -55,9 +55,14 @@ fn build_import_op_exec_ctx(
5555 let existing_keys_schema: & [ schema:: ValueType ] =
5656 if let Some ( keys_schema) = & state. keys_schema {
5757 keys_schema
58- } else if let Some ( key_schema) = & state. key_schema {
59- std:: slice:: from_ref ( key_schema)
6058 } else {
59+ #[ cfg( feature = "legacy-states-v0" ) ]
60+ if let Some ( key_schema) = & state. key_schema {
61+ std:: slice:: from_ref ( key_schema)
62+ } else {
63+ & [ ]
64+ }
65+ #[ cfg( not( feature = "legacy-states-v0" ) ) ]
6166 & [ ]
6267 } ;
6368 if existing_keys_schema == keys_schema_no_attrs. as_ref ( ) {
@@ -83,6 +88,7 @@ fn build_import_op_exec_ctx(
8388
8489 // Keep this field for backward compatibility,
8590 // so users can still swap back to older version if needed.
91+ #[ cfg( feature = "legacy-states-v0" ) ]
8692 key_schema : Some ( if keys_schema_no_attrs. len ( ) == 1 {
8793 keys_schema_no_attrs[ 0 ] . clone ( )
8894 } else {
Original file line number Diff line number Diff line change @@ -176,6 +176,7 @@ pub struct SourceSetupState {
176176 pub keys_schema : Option < Box < [ schema:: ValueType ] > > ,
177177
178178 /// DEPRECATED. For backward compatibility.
179+ #[ cfg( feature = "legacy-states-v0" ) ]
179180 #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
180181 pub key_schema : Option < schema:: ValueType > ,
181182
You can’t perform that action at this time.
0 commit comments