[PR #40] [MERGED] vectorstore: Add support to filter by IS NULL and IS NOT NULL criteria #131

Closed
opened 2026-02-16 05:16:42 -05:00 by yindo · 0 comments
Owner

📋 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: mainHead: add_support_for_null_conditions


📝 Commits (4)

  • 7b910ff Add support to filter by IS NULL and IS NOT NULL criteria
  • bb5e19a Update examples table
  • 7cf7355 Update to
  • dcb8419 Replace 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.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langchain-postgres/pull/40 **Author:** [@MartinGotelli](https://github.com/MartinGotelli) **Created:** 5/4/2024 **Status:** ✅ Merged **Merged:** 5/16/2024 **Merged by:** [@eyurtsev](https://github.com/eyurtsev) **Base:** `main` ← **Head:** `add_support_for_null_conditions` --- ### 📝 Commits (4) - [`7b910ff`](https://github.com/langchain-ai/langchain-postgres/commit/7b910ff75be2e65b56b074ac0b69fef8f76cc0cc) Add support to filter by IS NULL and IS NOT NULL criteria - [`bb5e19a`](https://github.com/langchain-ai/langchain-postgres/commit/bb5e19ac8b43c62ea4809087c85b770055ee34ce) Update examples table - [`7cf7355`](https://github.com/langchain-ai/langchain-postgres/commit/7cf73556c2a4816e6b0f1be65be2076a90f62bd9) Update to - [`dcb8419`](https://github.com/langchain-ai/langchain-postgres/commit/dcb84198630580b7025f7ec466839af90db498d6) Replace operator null to exists ### 📊 Changes **4 files changed** (+57 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 05:16:42 -05:00
yindo closed this issue 2026-02-16 05:16:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#131