Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Propagate segment information from frontend to query node #3255

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
3 changes: 3 additions & 0 deletions chromadb/proto/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,9 @@ def to_proto_scan(scan: Scan) -> query_pb.ScanOperator:
knn_id=scan.knn["id"].hex,
metadata_id=scan.metadata["id"].hex,
record_id=scan.record["id"].hex,
knn=to_proto_segment(scan.knn),
metadata=to_proto_segment(scan.metadata),
record=to_proto_segment(scan.record),
)


Expand Down
66 changes: 33 additions & 33 deletions chromadb/proto/query_executor_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions chromadb/proto/query_executor_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions idl/chromadb/proto/query_executor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import "chromadb/proto/chroma.proto";

message ScanOperator {
Collection collection = 1;
// Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add a bit more information as to why it has been deprecated and what is the new course of action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be removed in the next PR

string knn_id = 2;
// Deprecated
string metadata_id = 3;
// Deprecated
string record_id = 4;
Segment knn = 5;
Segment metadata = 6;
Segment record = 7;
}

message FilterOperator {
Expand Down
7 changes: 7 additions & 0 deletions rust/types/src/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::chroma_proto;
use chroma_error::{ChromaError, ErrorCodes};
use std::{collections::HashMap, str::FromStr};
use thiserror::Error;
use tonic::Status;
use uuid::Uuid;

/// SegmentUuid is a wrapper around Uuid to provide a type for the segment id.
Expand Down Expand Up @@ -106,6 +107,12 @@ impl ChromaError for SegmentConversionError {
}
}

impl From<SegmentConversionError> for Status {
fn from(value: SegmentConversionError) -> Self {
Status::invalid_argument(value.to_string())
}
}

impl TryFrom<chroma_proto::Segment> for Segment {
type Error = SegmentConversionError;

Expand Down
Loading
Loading