-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[CLN] Separate validation and transformation logic #2899
Conversation
Please tag your PR title with one of: [ENH | BUG | DOC | TST | BLD | PERF | TYP | CLN | CHORE]. See https://docs.trychroma.com/contributing#contributing-code-and-ideas |
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. |
4f829fc
to
9d25975
Compare
b948c07
to
440e3b2
Compare
b91c9e5
to
5d181a9
Compare
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.
At least on Github there is only 1 example of someone using where with an empty dict, but we can still communicate this change for clarity
0346548
to
4294588
Compare
4294588
to
8cb96fe
Compare
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 makes sense, I have left some questions. Except for the partial input problem everything looks great to me.
8cb96fe
to
b3f10d6
Compare
## Description of changes We perform validation, and transformations, on requests before we send them from the client to the server. Previously, these operations were not well modularized, leading to difficult to debug code, lots of exceptional paths, and overall not-niceness. This PR separates validation, and makes it idemponent, from transformations, for all methods on `Collection` in the python client. Along the way, this PR cleans up the possibility of sending empty lists or dicts as filters or lists of IDs, so that the tests are now consistent with our validators. In a future PR, we will also repeat this same validation logic server-side for use with clients other than our first party, and update it in JavaScript. ## Test plan CI Passes New validation to ensure empty filters trigger validators. ## Documentation Changes ## TODO - [ ] Technically this is a breaking API change, let's discuss
Description of changes
We perform validation, and transformations, on requests before we send them from the client to the server. Previously, these operations were not well modularized, leading to difficult to debug code, lots of exceptional paths, and overall not-niceness.
This PR separates validation, and makes it idemponent, from transformations, for all methods on
Collection
in the python client.Along the way, this PR cleans up the possibility of sending empty lists or dicts as filters or lists of IDs, so that the tests are now consistent with our validators.
In a future PR, we will also repeat this same validation logic server-side for use with clients other than our first party, and update it in JavaScript.
Test plan
CI Passes
New validation to ensure empty filters trigger validators.
Documentation Changes
TODO