Could you clarify why the "contains" operator is not implemented? #16

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

Originally created by @artefactop on GitHub (May 16, 2024).

Hi, we want to migrate from langchain_community and we are using the "contains" operator but is not implemented here.

Is there any reason?
If not, do you have plan to implement it?

Originally created by @artefactop on GitHub (May 16, 2024). Hi, we want to migrate from `langchain_community` and we are using the "contains" operator but is not implemented here. Is there any reason? If not, do you have plan to implement it?
yindo closed this issue 2026-02-16 05:16:05 -05:00
Author
Owner

@eyurtsev commented on GitHub (May 17, 2024):

The community implementation consists of two implementations:

  1. one that uses a JSON field -- this is the version that has contains operator. This version is also buggy as it casts things into text.
  2. I wrote a second implementation using a JSONB field that addresses most of the implementation issues. But it doesn't have a $contains operator.

You're free to contribute functionality for this!

What I'd be looking for are clear semantics for how the operator works together with complete test cases.

Possible types are for the field: None, str, float, int, List[float], List[int], List[str]

You can reference this recent PR to see how to go about doing that: https://github.com/langchain-ai/langchain-postgres/pull/40

@eyurtsev commented on GitHub (May 17, 2024): The community implementation consists of two implementations: 1) one that uses a JSON field -- this is the version that has `contains` operator. This version is also buggy as it casts things into text. 2) I wrote a second implementation using a JSONB field that addresses most of the implementation issues. But it doesn't have a $contains operator. You're free to contribute functionality for this! What I'd be looking for are clear semantics for how the operator works together with complete test cases. Possible types are for the field: None, str, float, int, List[float], List[int], List[str] You can reference this recent PR to see how to go about doing that: https://github.com/langchain-ai/langchain-postgres/pull/40
Author
Owner

@artefactop commented on GitHub (May 17, 2024):

Thanks @eyurtsev ! We'll definitely take a look at reviewing the implementation details you provided.

@artefactop commented on GitHub (May 17, 2024): Thanks @eyurtsev ! We'll definitely take a look at reviewing the implementation details you provided.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#16