Skip to content

Commit

Permalink
Follow upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Jan 16, 2025
1 parent 1b723da commit 378ee3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diracx-testing/src/diracx/testing/mock_osdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def upsert(self, doc_id, document) -> None:
await self._sql_db.conn.execute(stmt)

async def bulk_insert(self, index_name: str, docs: list[dict[str, Any]]) -> None:
async with self:
async with self._sql_db:
rows = []
for doc in docs:
# don't use doc_id column explicitly. This ensures that doc_id is unique.
Expand Down Expand Up @@ -169,7 +169,7 @@ async def search(
return results

async def delete(self, query: list[dict[str, Any]]) -> None:
async with self:
async with self._sql_db:
stmt = delete(self._table)
stmt = sql_utils.apply_search_filters(
self._table.columns.__getitem__, stmt, query
Expand Down

0 comments on commit 378ee3b

Please sign in to comment.