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] Add rust metadata gprc reader #2075

Closed
wants to merge 1 commit into from

Conversation

HammadB
Copy link
Collaborator

@HammadB HammadB commented Apr 27, 2024

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Fixes a bug in grpc metadata stub that does not pass None for where/where_document
  • New functionality
    • Adds the rust server bindings for metadata reader
    • Adds the metadata query orchestrator. For now this only handles get by ids (query_ids) it does not handle where/where_document and will error if requested.

Todo before we merge this

  • document handling in record segment
  • document handling of read logs - i'd like to pull the special magic keys "chroma:document" out and make them first class fields everywhere except transport in rust.

Todo after

  • updates/deletes

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

None

Copy link
Collaborator Author

HammadB commented Apr 27, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @HammadB and the rest of your teammates on Graphite Graphite

@HammadB HammadB mentioned this pull request Apr 27, 2024
1 task
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

request: pb.QueryMetadataRequest = pb.QueryMetadataRequest(
segment_id=self._segment["id"].hex,
where=where_pb,
where_document=where_document_pb,
where=self._where_to_proto(where) if where is not None else None,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for fixing my silly bugs!

@@ -91,6 +91,7 @@ impl Operator<BruteForceKnnOperatorInput, BruteForceKnnOperatorOutput> for Brute
let embedding = match &log_record.record.embedding {
Some(embedding) => embedding,
None => {
// Implies that the record is a delete or update of irrelevant field
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we need to go add delete/update

RECORD = "urn:chroma:segment/record"
BLOCKFILE_METADATA = "urn:chroma:segment/metadata/blockfile"
Copy link
Contributor

Choose a reason for hiding this comment

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

what is urn? i'm guessing this is just some common context in the rust codebase that i'm missing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we use https://en.wikipedia.org/wiki/Uniform_Resource_Name for the name of the segment types 🤷

request: pb.QueryMetadataRequest = pb.QueryMetadataRequest(
segment_id=self._segment["id"].hex,
where=where_pb,
where_document=where_document_pb,
where=self._where_to_proto(where) if where is not None else None,
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for fixing my silly bugs!

rust/worker/src/server.rs Show resolved Hide resolved
@HammadB HammadB mentioned this pull request May 7, 2024
4 tasks
@HammadB HammadB closed this May 7, 2024
HammadB added a commit that referenced this pull request May 7, 2024
## Description of changes
Replaces #2075 for merge conflict reasons :) 

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Fixes a bug in grpc metadata stub that does not pass None for
where/where_document
New functionality
- Adds the rust server bindings for metadata reader
- Adds the metadata query orchestrator. For now this only handles get by
ids (query_ids) it does not handle where/where_document and will error
if requested.

Todo before we merge this
- [x]  document handling in record segment
- [x] document handling of read logs - i'd like to pull the special
magic keys "chroma:document" out and make them first class fields
everywhere except transport in rust.

Todo after
- [ ] updates/deletes

## Test plan
*How are these changes tested?*
- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants