-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Added remove_texts on base, elasticsearch, pgvector vectorsearch #525
Conversation
@andreibondarev I have a little trouble understanding the problem with pgvector remove_texts. Can you check what the result value on tests? |
Hmmm... is it because we're adding other records to pgvector before this |
expect(ids.length).to eq(2) | ||
|
||
result = subject.remove_texts(ids: ids) | ||
expect(result.size).to eq(2) |
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.
1) Langchain::Vectorsearch::Pgvector#remove_texts removes texts
Failure/Error: expect(result.size).to eq(2)
expected: 2
got: 8
(compared using ==)
# ./spec/langchain/vectorsearch/pgvector_spec.rb:127:in `block (3 levels) in <top (required)>'
# ./spec/support/vcr.rb:22:in `block (3 levels) in <top (required)>'
# ./vendor/bundle/ruby/3.2.0/gems/vcr-6.2.0/lib/vcr.rb:274:in `turned_off'
# ./spec/support/vcr.rb:22:in `block (2 levels) in <top (required)>'
Finished in 4.16 seconds (files took 2.4 seconds to load)
426 examples, 1 failure, 3 pending
Failed examples:
rspec ./spec/langchain/vectorsearch/pgvector_spec.rb:121 # Langchain::Vectorsearch::Pgvector#remove_texts removes texts
Perhaps the result object is stale somehow? Can we try using:
subject.db.count
to see if it returns accurate count?
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.
@andreibondarev I don't have a local pg vector database to test it. Can you try to run only remove_texts test to check length?
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.
@gregogalante Turns out that result
is the actual number of elements deleted:
result = subject.remove_texts(ids: ids)
expect(result.size).to eq(2)
But when you call result.size
it's the same as calling 2.size
which is the number of bytes that Integer represent.
@gregogalante I cherry-picked some of your commits out to focus on this PR on just the Pgvector. |
No description provided.