Skip to content

Commit

Permalink
[CLN] Cleanup frontend after query pushdown (#3291)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
   - Remove `Grpc*Segment` implementation in frontend, since they are no longer used after query pushdown
   - Remove `test_version_mismatch.py` and corresponding exception handling in distributed executor, since we no longer have version mismatch after passing the full collection and segment information form frontend
   - Add a few tests in `test_protobuf_translation.py` to test translation for collection and segment information
 - New functionality
   - N/A

## Test plan
*How are these changes tested?*

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?*
N/A
  • Loading branch information
Sicheng-Pan authored Dec 17, 2024
1 parent c7c4dda commit da0858d
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 894 deletions.
15 changes: 0 additions & 15 deletions chromadb/execution/executor/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ def count(self, plan: CountPlan) -> int:
try:
count_result = executor.Count(convert.to_proto_count_plan(plan))
except grpc.RpcError as rpc_error:
if (
rpc_error.code() == grpc.StatusCode.INTERNAL
and "version mismatch" in rpc_error.details()
):
raise VersionMismatchError()
raise rpc_error
return convert.from_proto_count_result(count_result)

Expand All @@ -71,11 +66,6 @@ def get(self, plan: GetPlan) -> GetResult:
try:
get_result = executor.Get(convert.to_proto_get_plan(plan))
except grpc.RpcError as rpc_error:
if (
rpc_error.code() == grpc.StatusCode.INTERNAL
and "version mismatch" in rpc_error.details()
):
raise VersionMismatchError()
raise rpc_error
records = convert.from_proto_get_result(get_result)

Expand Down Expand Up @@ -118,11 +108,6 @@ def knn(self, plan: KNNPlan) -> QueryResult:
try:
knn_result = executor.KNN(convert.to_proto_knn_plan(plan))
except grpc.RpcError as rpc_error:
if (
rpc_error.code() == grpc.StatusCode.INTERNAL
and "version mismatch" in rpc_error.details()
):
raise VersionMismatchError()
raise rpc_error
results = convert.from_proto_knn_batch_result(knn_result)

Expand Down
Loading

0 comments on commit da0858d

Please sign in to comment.