diff --git a/chromadb/api/segment.py b/chromadb/api/segment.py index 0ade237d22a..b25d6550182 100644 --- a/chromadb/api/segment.py +++ b/chromadb/api/segment.py @@ -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 diff --git a/chromadb/test/property/test_sysdb.py b/chromadb/test/property/test_sysdb.py index 0f57b794981..13708c21435 100644 --- a/chromadb/test/property/test_sysdb.py +++ b/chromadb/test/property/test_sysdb.py @@ -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: