style(proxy): satisfy ANN204 and SIM117 in the budget window spend writer

This commit is contained in:
ryan-crabbe-berri 2026-08-29 12:27:57 -07:00
parent 4e22a5ef5a
commit 6ef42f5991
2 changed files with 10 additions and 8 deletions

View file

@ -275,13 +275,15 @@ async def commit_window_spend_updates(
len(ordered),
len(existing_primary_keys),
)
async with prisma_client.db.tx(timeout=_UPSERT_TRANSACTION_TIMEOUT) as db_transaction:
async with db_transaction.batch_() as batcher:
for transaction, seed_base in zip(ordered, seed_bases):
batcher.execute_raw(
_UPSERT_WINDOW_SPEND_SQL,
*_upsert_params(transaction=transaction, seed_base=seed_base, now=now),
)
async with (
prisma_client.db.tx(timeout=_UPSERT_TRANSACTION_TIMEOUT) as db_transaction,
db_transaction.batch_() as batcher,
):
for transaction, seed_base in zip(ordered, seed_bases):
batcher.execute_raw(
_UPSERT_WINDOW_SPEND_SQL,
*_upsert_params(transaction=transaction, seed_base=seed_base, now=now),
)
async def roll_window_spend_row(

View file

@ -121,7 +121,7 @@ class WindowSpendUpdateQueue(BaseUpdateQueue):
)
"""
def __init__(self):
def __init__(self) -> None:
super().__init__()
self.update_queue: asyncio.Queue[tuple[WindowSpendTransaction, ...]] = asyncio.Queue(
maxsize=LITELLM_ASYNCIO_QUEUE_MAXSIZE