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:
Ian 2024-01-09 04:26:29 +08:00 committed by GitHub
parent fc3cb64dc3
commit 32ec56194b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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