Skip to content

Commit

Permalink
Rename field
Browse files Browse the repository at this point in the history
  • Loading branch information
Sicheng Pan committed Dec 11, 2024
1 parent c43586d commit 9a70ee3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions chromadb/api/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,13 @@ def _get_collection(self, collection_id: UUID) -> t.Collection:

@trace_method("SegmentAPI._scan", OpenTelemetryGranularity.ALL)
def _scan(self, collection_id: UUID) -> Scan:
collection_segments = self._sysdb.get_collection_with_segments(collection_id)
collection_and_segments = self._sysdb.get_collection_with_segments(collection_id)
# For now collection should have exactly one segment per scope:
# - Local scopes: vector, metadata
# - Distributed scopes: vector, metadata, record
scope_to_segment = {segment["scope"]: segment for segment in collection_segments["segments"]}
scope_to_segment = {segment["scope"]: segment for segment in collection_and_segments["segments"]}
return Scan(
collection=collection_segments["collection"],
collection=collection_and_segments["collection"],
knn=scope_to_segment[t.SegmentScope.VECTOR],
metadata=scope_to_segment[t.SegmentScope.METADATA],
# Local chroma do not have record segment, and this is not used by the local executor
Expand Down
6 changes: 3 additions & 3 deletions chromadb/test/property/test_sysdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ def get_collection_with_segments(self, coll: strategies.Collection) -> None:
coll.name in self.created_collections
and coll.id == self.created_collections[coll.name].id
):
fetched_collection_segments = self.sysdb.get_collection_with_segments(
fetched_collection_and_segments = self.sysdb.get_collection_with_segments(
collection_id=coll.id
)
assert fetched_collection_segments["collection"].name == coll.name
assert fetched_collection_and_segments["collection"].name == coll.name
scopes = []
for segment in fetched_collection_segments["segments"]:
for segment in fetched_collection_and_segments["segments"]:
assert segment["collection"] == coll.id
scopes.append(segment["scope"])
if NOT_CLUSTER_ONLY:
Expand Down

0 comments on commit 9a70ee3

Please sign in to comment.