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]: clarify non-included fields in .get() and .query() responses #2028

Closed
wants to merge 2 commits into from

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Apr 19, 2024

Description of changes

Closes #300.

print(collection.get(...)) now looks like this:

Screenshot 2024-04-19 at 10 10 03 AM

Could use some opinions on this--is it too verbose? I figured it would be better to be consistent across all fields affected by include, but we could scope this to just embeddings for now as well.

This can probably be rolled into 0.5 as a potentially breaking change (embeddings is None will no longer work).

Test plan

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

Documentation Changes

Existing docs don't really give much details on how the response shape changes depending on include, so not necessary to update but might be nice to give additional details.

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)

@codetheweb codetheweb changed the title Clarify non-included fields in .get() and .query() responses ENH: clarify non-included fields in .get() and .query() responses Apr 19, 2024
@codetheweb codetheweb changed the title ENH: clarify non-included fields in .get() and .query() responses [ENH]: clarify non-included fields in .get() and .query() responses Apr 19, 2024
Copy link

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

@chroma-core chroma-core deleted a comment from github-actions bot Apr 19, 2024
@chroma-core chroma-core deleted a comment from github-actions bot Apr 19, 2024
@codetheweb codetheweb force-pushed the fix-omitted-fields branch 2 times, most recently from 064fd90 to 017b1ea Compare April 19, 2024 17:58
@codetheweb codetheweb marked this pull request as ready for review April 19, 2024 19:56
Copy link
Contributor

@beggers beggers left a comment

Choose a reason for hiding this comment

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

This looks good to me. This is a change to our API and some of our users may be surprised -- could you put a note in https://docs.trychroma.com/migration about it? I don't think we need to do email comms but we should definitely do discord comms.

@codetheweb
Copy link
Contributor Author

codetheweb commented Apr 19, 2024

could you put a note in docs.trychroma.com/migration about it

#2028

@jeffchuber
Copy link
Contributor

w00t!

@jeffchuber
Copy link
Contributor

@codetheweb should we standardize this and add it to JS as well? (separate PR works for me)

@codetheweb
Copy link
Contributor Author

codetheweb commented Apr 19, 2024

should we standardize this and add it to JS as well? (separate PR works for me)

to be honest, I'm not sure, I feel like (good) Python SDKs tend to use helper classes whereas JS SDKs tend to use plain objects without magic behavior; but maybe it makes sense for consistency

we could also improve the typings of the JS SDK so the return type is dependent upon the include parameter

@codetheweb
Copy link
Contributor Author

Closing in favor of #2044.

@codetheweb codetheweb closed this Apr 23, 2024
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.

Improve message on collection.get empty embeddings
3 participants