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

[CHORE] Make a ChromaError type for RuntimeTypeError #2866

Merged
merged 7 commits into from
Sep 26, 2024

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented Sep 26, 2024

Description of changes

Summarize the changes made by this PR.

  • Fixes from another PR that I merged too fast.

Test plan

How are these changes tested?

  • cargo check + CI

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

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)

// TODO(rescrv): This used to be a panic/unwrap, but could be a nicer type.
#[derive(thiserror::Error, Debug)]
#[error("runtime type error")]
pub struct RuntimeTypeError;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe "InvalidKeyConversion"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Naming is hard. Thank you for doing the hard work :-)

while let Some((_, index)) = self.cache.pop() {
let index_id = index.inner.read().id;
/// Purge entries from the cache by index ID and remove temporary files from disk.
pub async fn purge_by_id(&mut self, index_ids: &[Uuid]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

i think some wires from another PR may have gotten crossed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrong base. Updated.

@rescrv rescrv changed the base branch from main to rescrv/compact-no-pop September 26, 2024 20:02
Base automatically changed from rescrv/compact-no-pop to main September 26, 2024 22:45
@rescrv rescrv merged commit 93d0a62 into main Sep 26, 2024
70 checks passed
@rescrv rescrv deleted the rescrv/fix-error-type branch September 26, 2024 23:15
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