mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-28 09:28:48 +00:00
community: fix myscale delete function bug (#15675)
Now the SQL used to delete vector doc from myscale is as follow: ```sql DELETE FROM collection WHERE id = '1' AND id = '2' AND id = '3' ``` But the expected one should be ```sql DELETE FROM collection WHERE id IN ('1', '2', '3') ```
This commit is contained in:
parent
fc3cb64dc3
commit
32ec56194b
@ -470,8 +470,9 @@ class MyScale(VectorStore):
|
||||
ids is None and where_str is None
|
||||
), "You need to specify where to be deleted! Either with `ids` or `where_str`"
|
||||
conds = []
|
||||
if ids:
|
||||
conds.extend([f"{self.config.column_map['id']} = '{id}'" for id in ids])
|
||||
if ids and len(ids) > 0:
|
||||
id_list = ", ".join([f"'{id}'" for id in ids])
|
||||
conds.append(f"{self.config.column_map['id']} IN ({id_list})")
|
||||
if where_str:
|
||||
conds.append(where_str)
|
||||
assert len(conds) > 0
|
||||
|
Loading…
Reference in New Issue
Block a user