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

feat: Chroma - defer the DB connection #1107

Merged
merged 6 commits into from
Sep 30, 2024

Conversation

alperkaya
Copy link
Contributor

Related Issues

Proposed Changes:

How did you test it?

run unit & integration tests

Notes for the reviewer

Checklist

@alperkaya alperkaya requested a review from a team as a code owner September 25, 2024 19:21
@alperkaya alperkaya requested review from shadeMe and removed request for a team September 25, 2024 19:21
@alperkaya alperkaya changed the title defer the DB conn from chroma feat: defer the DB conn from chroma Sep 25, 2024
@anakin87 anakin87 self-requested a review September 25, 2024 19:47
@github-actions github-actions bot added the type:documentation Improvements or additions to documentation label Sep 26, 2024
Comment on lines 97 to 99
self._chroma_client = self.chroma_client()
self._collection = self.collection()
self._initialized = True
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's inline these two function calls and remove the individual methods - I don't think they are used anywhere else.

Comment on lines 158 to 160
if self._collection is None:
msg = "Collection is not initialized"
raise ValueError(msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Both the collection and client variables should be initialized after the call to _ensure_initialized , so there's no reason to raise. We can replace that with assert self._collection is not None instead (same with the other variable wherever it needs to be directly accessed).

@alperkaya
Copy link
Contributor Author

I made the changes as you pointed out. LMK your comments.

Copy link
Contributor

@shadeMe shadeMe left a comment

Choose a reason for hiding this comment

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

@anakin87 I'll leave the final approval to you (once the tests are fixed).

@alperkaya
Copy link
Contributor Author

@anakin87 I'll leave the final approval to you (once the tests are fixed).

I've been looking into the test failures, but I'm having trouble interpreting them, as they seem to be open to different interpretations. I’d appreciate it if you could help clarify what might be causing the issue or what direction I should take to resolve this.

@anakin87
Copy link
Member

I will take a look...

@anakin87 anakin87 changed the title feat: defer the DB conn from chroma feat: Chroma - defer the DB connection Sep 30, 2024
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

After fixing some small things, I'm going to merge this PR and release a new version of chroma-haystack.
Thanks!

@anakin87 anakin87 merged commit 242e3c5 into deepset-ai:main Sep 30, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration:chroma type:documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chroma - defer the DB connection
3 participants