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

community: allow chroma DB delete() to use "where" argument #19826

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

conjuncts
Copy link
Contributor

Thank you for contributing to LangChain!

  • PR title: "package: description"
    • Where "package" is whichever of langchain, community, core, experimental, etc. is being modified. Use "docs: ..." for purely docs changes, "templates: ..." for template changes, "infra: ..." for CI changes.
    • Example: "community: add foobar LLM"

Description: Simply pass kwargs to allow arguments like "where" to be propagated
Issue: Previously, db.delete(where={}) wouldn't work for chroma vectorstores
Dependencies: N/A
Twitter handle: N/A

  • Add tests and docs: If you're adding a new integration, please include

    1. a test for the integration, preferably unit tests that do not rely on network access,
    2. an example notebook showing its use. It lives in docs/docs/integrations directory.
  • Lint and test: Run make format, make lint and make test from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:

  • Make sure optional dependencies are imported within a function.
  • Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests.
  • Most PRs should not touch more than one package.
  • Changes should be backwards compatible.
  • If you are adding something to community, do not re-import it in langchain.

If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, hwchase17.

Allow .delete(where={}) to work for chroma vectorstores
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 31, 2024
Copy link

vercel bot commented Mar 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 31, 2024 5:27pm

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🔌: chroma Primarily related to ChromaDB integrations 🤖:improvement Medium size change to existing code to handle new use-cases labels Mar 31, 2024
@@ -798,7 +798,7 @@ def delete(self, ids: Optional[List[str]] = None, **kwargs: Any) -> None:
Args:
ids: List of ids to delete.
"""
self._collection.delete(ids=ids)
self._collection.delete(ids=ids, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

delete lets you pass where and where_document, but wouldn't passing additional kwargs cause an error? @baskaryan

@ccurme ccurme added the community Related to langchain-community label Jun 18, 2024
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Aug 23, 2024
@ccurme ccurme merged commit 818267b into langchain-ai:master Aug 23, 2024
59 checks passed
@ansells
Copy link

ansells commented Sep 6, 2024

Why is this fix only in the community version of the chroma vector store and not the official version?

The documentation for that module says its deprecated:
https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.chroma.Chroma.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: chroma Primarily related to ChromaDB integrations community Related to langchain-community 🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. size:XS This PR changes 0-9 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants