mirror of
https://github.com/hwchase17/langchain
synced 2024-11-18 09:25:54 +00:00
community[patch]: missing unpack operator for or_clause in pgvector document filter (#16148)
- Fix for #16146 - Adding unpack operation to "or" and "and" filter for pgvector retriever. #
This commit is contained in:
parent
3606c5d5e9
commit
d91126fc64
@ -545,13 +545,13 @@ class PGVector(VectorStore):
|
||||
self._create_filter_clause(key, sub_value)
|
||||
for sub_value in value_case_insensitive[OR]
|
||||
]
|
||||
filter_by_metadata = sqlalchemy.or_(or_clauses)
|
||||
filter_by_metadata = sqlalchemy.or_(*or_clauses)
|
||||
elif AND in map(str.lower, value):
|
||||
and_clauses = [
|
||||
self._create_filter_clause(key, sub_value)
|
||||
for sub_value in value_case_insensitive[AND]
|
||||
]
|
||||
filter_by_metadata = sqlalchemy.and_(and_clauses)
|
||||
filter_by_metadata = sqlalchemy.and_(*and_clauses)
|
||||
|
||||
else:
|
||||
filter_by_metadata = None
|
||||
|
Loading…
Reference in New Issue
Block a user