Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chromadb/api/models/CollectionCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def _get_sparse_embedding_targets(self) -> Dict[str, "SparseVectorIndexConfig"]:
return {}

targets: Dict[str, "SparseVectorIndexConfig"] = {}
for key, value_types in schema.key_overrides.items():
for key, value_types in schema.keys.items():
if value_types.sparse_vector is None:
continue
sparse_index = value_types.sparse_vector.sparse_vector_index
Expand Down
256 changes: 128 additions & 128 deletions chromadb/api/types.py

Large diffs are not rendered by default.

1,092 changes: 546 additions & 546 deletions chromadb/test/api/test_schema.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions chromadb/test/api/test_schema_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_schema_spann_vector_config_persistence(
persisted_schema = collection.schema
assert persisted_schema is not None

vector_index = persisted_schema.key_overrides["$embedding"].float_list.vector_index
vector_index = persisted_schema.keys["#embedding"].float_list.vector_index
assert vector_index.enabled is True
assert vector_index.config.spann is not None
spann_config = vector_index.config.spann
Expand All @@ -103,8 +103,8 @@ def test_schema_spann_vector_config_persistence(
assert ef.get_config() == {"dim": 6}

persisted_json = persisted_schema.serialize_to_json()
spann_json = persisted_json["key_overrides"]["$embedding"]["#float_list"][
"$vector_index"
spann_json = persisted_json["keys"]["#embedding"]["float_list"][
"vector_index"
]["config"]["spann"]
assert spann_json["search_nprobe"] == 16
assert spann_json["write_nprobe"] == 32
Expand All @@ -117,8 +117,8 @@ def test_schema_spann_vector_config_persistence(

reloaded_schema = reloaded_collection.schema
assert reloaded_schema is not None
reloaded_vector_index = reloaded_schema.key_overrides[
"$embedding"
reloaded_vector_index = reloaded_schema.keys[
"#embedding"
].float_list.vector_index
assert reloaded_vector_index.config.spann is not None
assert reloaded_vector_index.config.spann.search_nprobe == 16
Expand Down
28 changes: 14 additions & 14 deletions clients/new-js/packages/chromadb/src/api/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type BoolInvertedIndexType = {
* Boolean value type index configurations
*/
export type BoolValueType = {
$bool_inverted_index?: null | BoolInvertedIndexType;
bool_inverted_index?: null | BoolInvertedIndexType;
};

export type ChecklistResponse = {
Expand Down Expand Up @@ -142,14 +142,14 @@ export type FloatInvertedIndexType = {
* Float list value type index configurations (for vectors)
*/
export type FloatListValueType = {
$vector_index?: null | VectorIndexType;
vector_index?: null | VectorIndexType;
};

/**
* Float value type index configurations
*/
export type FloatValueType = {
$float_inverted_index?: null | FloatInvertedIndexType;
float_inverted_index?: null | FloatInvertedIndexType;
};

export type ForkCollectionPayload = {
Expand Down Expand Up @@ -239,7 +239,7 @@ export type IntInvertedIndexType = {
* Integer value type index configurations
*/
export type IntValueType = {
$int_inverted_index?: null | IntInvertedIndexType;
int_inverted_index?: null | IntInvertedIndexType;
};

/**
Expand All @@ -254,7 +254,7 @@ export type InternalSchema = {
/**
* Key-specific index overrides
*/
key_overrides: {
keys: {
[key: string]: ValueTypes;
};
};
Expand Down Expand Up @@ -400,7 +400,7 @@ export type SparseVectorIndexType = {
* Sparse vector value type index configurations
*/
export type SparseVectorValueType = {
$sparse_vector_index?: null | SparseVectorIndexType;
sparse_vector_index?: null | SparseVectorIndexType;
};

export type StringInvertedIndexConfig = {
Expand All @@ -416,8 +416,8 @@ export type StringInvertedIndexType = {
* String value type index configurations
*/
export type StringValueType = {
$fts_index?: null | FtsIndexType;
$string_inverted_index?: null | StringInvertedIndexType;
fts_index?: null | FtsIndexType;
string_inverted_index?: null | StringInvertedIndexType;
};

export type UpdateCollectionConfiguration = {
Expand Down Expand Up @@ -489,12 +489,12 @@ export type UpsertCollectionRecordsResponse = {
* Contains optional configurations for each supported value type
*/
export type ValueTypes = {
'#bool'?: null | BoolValueType;
'#float'?: null | FloatValueType;
'#float_list'?: null | FloatListValueType;
'#int'?: null | IntValueType;
'#sparse_vector'?: null | SparseVectorValueType;
'#string'?: null | StringValueType;
bool?: null | BoolValueType;
float?: null | FloatValueType;
float_list?: null | FloatListValueType;
int?: null | IntValueType;
sparse_vector?: null | SparseVectorValueType;
string?: null | StringValueType;
};

export type Vec = Array<{
Expand Down
Loading
Loading