Skip to content

Commit

Permalink
fix: consider delete successful if doc was not in db (#107)
Browse files Browse the repository at this point in the history
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
  • Loading branch information
kyteinsky authored Nov 22, 2024
1 parent 633191d commit 74509a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions context_chat_backend/vectordb/pgvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ def delete(self, user_id: str, metadata_key: str, values: list[str]) -> bool:
.filter(client.EmbeddingStore.cmetadata[metadata_key].in_([sa.cast(f'"{v}"', JSONB) for v in values]))
)

result = session.execute(stmt)
session.execute(stmt)
session.commit()

if result.rowcount == 0:
return False

return True

0 comments on commit 74509a3

Please sign in to comment.