mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
[PR #40] [MERGED] vectorstore: Add support to filter by IS NULL and IS NOT NULL criteria #131
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langchain-ai/langchain-postgres/pull/40
Author: @MartinGotelli
Created: 5/4/2024
Status: ✅ Merged
Merged: 5/16/2024
Merged by: @eyurtsev
Base:
main← Head:add_support_for_null_conditions📝 Commits (4)
7b910ffAdd support to filter by IS NULL and IS NOT NULL criteriabb5e19aUpdate examples table7cf7355Update todcb8419Replace operator null to exists📊 Changes
4 files changed (+57 additions, -3 deletions)
View changed files
📝
examples/vectorstore.ipynb(+3 -2)📝
langchain_postgres/vectorstores.py(+13 -1)📝
tests/unit_tests/fixtures/filtering_test_cases.py(+26 -0)📝
tests/unit_tests/test_vectorstore.py(+15 -0)📄 Description
Description: Add support to filter by IS NULL criteria in the metadata
Issue: N/A
Dependencies: N/A
Twitter handle: @martinferenaz
This PR fixes the problem when you want to search if a tag has a value (exists) in the metadata. To check that you need to compare with the "IS NULL" method and the "$eq" operator only checks that the tag exists and has a null value assigned.
In addition, a test for the $nin condition was added and a bug arrised, the bug was resolved adding a not condition after the in_
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.