Skip to content

Commit

Permalink
Convert scan version to property
Browse files Browse the repository at this point in the history
  • Loading branch information
Sicheng Pan authored and Sicheng-Pan committed Oct 14, 2024
1 parent f1db70c commit f5b9c8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions chromadb/execution/executor/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# TODO: This will be refactored after grpc defs have been updated for query pushdown

from typing import Optional, Sequence
from uuid import UUID

from chromadb.api.types import (
GetResult,
Expand All @@ -16,7 +15,7 @@
from chromadb.segment.impl.manager.distributed import DistributedSegmentManager
from chromadb.segment.impl.metadata.grpc_segment import GrpcMetadataSegment
from chromadb.segment.impl.vector.grpc_segment import GrpcVectorSegment
from chromadb.types import VectorQuery, VectorQueryResult
from chromadb.types import VectorQuery, VectorQueryResult, Collection
from overrides import overrides


Expand Down Expand Up @@ -180,8 +179,8 @@ def knn(self, plan: KNNPlan) -> QueryResult:
included=included,
)

def _metadata_segment(self, collection_id: UUID) -> GrpcMetadataSegment:
return self._manager.get_segment(collection_id, GrpcMetadataSegment)
def _metadata_segment(self, collection: Collection) -> GrpcMetadataSegment:
return self._manager.get_segment(collection.id, GrpcMetadataSegment)

def _vector_segment(self, collection_id: UUID) -> GrpcVectorSegment:
return self._manager.get_segment(collection_id, GrpcVectorSegment)
def _vector_segment(self, collection: Collection) -> GrpcVectorSegment:
return self._manager.get_segment(collection.id, GrpcVectorSegment)
11 changes: 5 additions & 6 deletions chromadb/execution/executor/local.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Optional, Sequence
from uuid import UUID

from chromadb.api.types import (
GetResult,
Expand All @@ -13,7 +12,7 @@
from chromadb.segment.impl.manager.local import LocalSegmentManager
from chromadb.segment.impl.metadata.sqlite import SqliteMetadataSegment
from chromadb.segment.impl.vector.local_hnsw import LocalHnswSegment
from chromadb.types import VectorQuery, VectorQueryResult
from chromadb.types import VectorQuery, VectorQueryResult, Collection
from overrides import overrides


Expand Down Expand Up @@ -177,8 +176,8 @@ def knn(self, plan: KNNPlan) -> QueryResult:
included=included,
)

def _metadata_segment(self, collection_id: UUID) -> SqliteMetadataSegment:
return self._manager.get_segment(collection_id, SqliteMetadataSegment)
def _metadata_segment(self, collection: Collection) -> SqliteMetadataSegment:
return self._manager.get_segment(collection.id, SqliteMetadataSegment)

def _vector_segment(self, collection_id: UUID) -> LocalHnswSegment:
return self._manager.get_segment(collection_id, LocalHnswSegment)
def _vector_segment(self, collection: Collection) -> LocalHnswSegment:
return self._manager.get_segment(collection.id, LocalHnswSegment)

0 comments on commit f5b9c8f

Please sign in to comment.