-
Notifications
You must be signed in to change notification settings - Fork 2k
[ENH]: Make error messages in attach_function clearer #5973
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
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Improve attach_function validation and error surfacing across stack This PR tightens attach_function validation in the Go coordinator, updates Rust clients to surface precise gRPC errors, and expands distributed integration tests to cover newly handled cases. It introduces deterministic function-ID to name mapping for built-in operators, enforces empty params, and ensures output-collection conflicts and mismatched attachments return actionable messages end-to-end. Key Changes• Refactored Affected Areas• go/pkg/sysdb/coordinator/task.go This summary was automatically generated by @propel-code-bot |
This comment has been minimized.
This comment has been minimized.
8740ade to
6464a8c
Compare
rust/sysdb/src/sysdb.rs
Outdated
| AlreadyExists, | ||
| #[error("{0}")] | ||
| CollectionAlreadyHasFunction(String), | ||
| #[error("{0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to see if this is ok
6464a8c to
db34d2a
Compare
db34d2a to
2bc13cf
Compare
2bc13cf to
d05f840
Compare
This comment has been minimized.
This comment has been minimized.
dfd5bd9 to
2bfc4a0
Compare
| chroma_types::FinishCreateAttachedFunctionError::OutputCollectionExists => { | ||
| chroma_types::AttachFunctionError::OutputCollectionExists( | ||
| output_collection.clone(), | ||
| ) | ||
| } | ||
| chroma_types::FinishCreateAttachedFunctionError::AttachedFunctionNotFound => { | ||
| chroma_types::AttachFunctionError::Internal(Box::new(e)) | ||
| } | ||
| chroma_types::FinishCreateAttachedFunctionError::FailedToFinishCreateAttachedFunction( | ||
| status, | ||
| ) => chroma_types::AttachFunctionError::Internal(Box::new( | ||
| chroma_error::TonicError(status), | ||
| )), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason AttachFunctionError doesn't just have a Finish variant that takes one of these as its arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and cleaned up
| // Note: validateAttachedFunctionMatchesRequest uses dbmodel.GetFunctionNameByID (static lookup) | ||
| // which returns "record_counter" for FunctionRecordCounter - different from requestedOperatorName | ||
| // Validation returns (false, nil) early, so DatabaseDb.GetDatabases is NOT called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it different from recordOperatorName? What's the implication? Tell me that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI wrote this but requestedOperatorName is a variable above. This test seeks to make sure that if you try to attach another function to a collection that already has a different function attached, you will try to see if the requested function attachment matches the previously attached function and fail. This part of the test makes sure that it doesn't make any further database calls during this check/
2bfc4a0 to
f181672
Compare
This comment has been minimized.
This comment has been minimized.
rescrv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd clean up the logging sprintf so it looks good when it errors.
rust/sysdb/src/sysdb.rs
Outdated
| pub enum AttachFunctionError { | ||
| #[error("Attached function already exists")] | ||
| AlreadyExists, | ||
| #[error("{0}")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will sprintf the string with no per-variant string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
f181672 to
4a11b06
Compare
4a11b06 to
1156e23
Compare
1156e23 to
8aa4f5f
Compare

Description of changes
Summarize the changes made by this PR.
Test plan
How are these changes tested?
pytestfor python,yarn testfor js,cargo testfor rustMigration plan
Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?
Observability plan
What is the plan to instrument and monitor this change?
Documentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the _docs section?_