-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: main
Are you sure you want to change the base?
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
coll.add(ids=ooo_ids, embeddings=embeddings) | ||
get_ids = coll.get(ids=ooo_ids)["ids"] | ||
assert get_ids == ooo_ids | ||
|
||
|
||
@pytest.mark.xfail(reason="Partial records aren't in our API contract...") |
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 don't think we actually intend to support this? This is very old code and I'm not sure it's used anywhere.
440e3b2
to
b91c9e5
Compare
b91c9e5
to
5d181a9
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 each type of request against our API.
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.
Test plan
CI Passes
New validation to ensure empty filters trigger validators.
Documentation Changes
TODO