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

Fixes for add and delete Methods in LanceDBVectorStore #11825

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

smendig
Copy link
Contributor

@smendig smendig commented Mar 11, 2024

Description

Two fixes to the LanceDBVectorStore class. These fixes address issues encountered when invoking the add method with an empty list and using an incorrect field name in the delete method. I encountered this errors while using LanceDB with Ingestion Pipeline + Document Management (similar to this but with LanceDB vector store), when the ingestion pipeline tries to apply the changes in documents to the vector database.

I've created this Colab to reproduce the issues:
https://colab.research.google.com/drive/1F-3NNPv1zcJLA6NDdE2QtaqAuF3V5P1F?usp=sharing

Handling Empty List in add Method

Invoking add([]) leads to an IndexError due to an attempt to access the first element of an empty list in the . Added a check at the beginning of the add method to return early if the input list is empty.

Correcting Field Name in delete Method

The delete method uses an incorrect field name (document_id) for deletion, the field name is set here, when deleting it should use the same field name.

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • No

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added new unit/integration tests
  • Added new notebook (that tests end-to-end)
  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added Google Colab support for the newly added notebooks.
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 11, 2024
@hatianzhang hatianzhang merged commit 3e5d0a1 into run-llama:main Mar 11, 2024
8 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 11, 2024
bdonkey added a commit to bdonkey/gpt_index that referenced this pull request Mar 12, 2024
* main:
  add retries for openai LLM rate limit errors (run-llama#11867)
  Fix stream chat param error in CondenseQuestionChatEngine (run-llama#11856)
  Add logprobs field to `CompletionResponse` (run-llama#11855)
  Google readers integrations doc and drive updates (run-llama#11724)
  Adds llamafile support for local LLM and embeddings (run-llama#11709)
  Add QueryUnderstandingAgent LlamaPack (run-llama#11558)
  Split Google docs on headings (run-llama#11535)
  add baidu vectordb as vector store (run-llama#11494)
  [Feature Request]: add PowerPoint support to Confluence reader run-llama#10592 (run-llama#11454)
  add modelscope llm support (run-llama#11270)
  Add cohere command-R model (run-llama#11852)
  Fixed some gramatical mistakes  (run-llama#11840)
  fix obj insert_nodes (run-llama#11836)
  added table comment to Table Info in SQLDatabase (run-llama#11774)
  Fixes for add and delete Methods in LanceDBVectorStore (run-llama#11825)
  add support for open-mixtral-8x7b (run-llama#11792)
  Adds new LabelledSimpleDataset (llama-dataset) (run-llama#11805)
  Fix Cohere Embeddings issue run-llama#11820 (run-llama#11822)
  Update verifying connection (run-llama#11821)
  bump mistralai deps (run-llama#11819)
Izukimat pushed a commit to Izukimat/llama_index that referenced this pull request Mar 29, 2024
fix: Fixes for add and delete Methods in LanceDBVectorStore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants