From b4743ced3d75f8f1e42985be1e5a904e4658a91b Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 29 Sep 2026 22:51:05 -0700 Subject: [PATCH] style(agent-tracing): apply ruff lint to clickhouse writer --- .../integrations/clickhouse/clickhouse_writer.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/litellm/integrations/clickhouse/clickhouse_writer.py b/litellm/integrations/clickhouse/clickhouse_writer.py index 7f045031eec..735cc0dc6af 100644 --- a/litellm/integrations/clickhouse/clickhouse_writer.py +++ b/litellm/integrations/clickhouse/clickhouse_writer.py @@ -7,7 +7,7 @@ enqueue or are told the buffer is full (the OTLP endpoint turns that into a 429) import asyncio from collections import defaultdict -from typing import Any, Dict, List +from typing import Any from litellm._logging import verbose_logger from litellm.constants import ( @@ -22,16 +22,16 @@ from litellm.integrations.clickhouse.clickhouse_client import ClickHouseClient class ClickHouseWriter: def __init__(self, client: ClickHouseClient): self.client = client - self.buffers: Dict[str, List[Dict[str, Any]]] = defaultdict(list) - self.rows_written: Dict[str, int] = defaultdict(int) - self.rows_dropped: Dict[str, int] = defaultdict(int) + self.buffers: dict[str, list[dict[str, Any]]] = defaultdict(list) + self.rows_written: dict[str, int] = defaultdict(int) + self.rows_dropped: dict[str, int] = defaultdict(int) self._flush_lock = asyncio.Lock() - self._task: "asyncio.Task | None" = None + self._task: asyncio.Task | None = None def is_full(self, table: str) -> bool: return len(self.buffers[table]) >= CLICKHOUSE_MAX_BUFFERED_ROWS - def enqueue(self, table: str, rows: List[Dict[str, Any]]) -> None: + def enqueue(self, table: str, rows: list[dict[str, Any]]) -> None: self.buffers[table].extend(rows) def start(self) -> None: @@ -51,7 +51,7 @@ class ClickHouseWriter: del self.buffers[table][: len(batch)] await self._insert_with_retry(table, batch) - async def _insert_with_retry(self, table: str, batch: List[Dict[str, Any]]) -> None: + async def _insert_with_retry(self, table: str, batch: list[dict[str, Any]]) -> None: for attempt in range(CLICKHOUSE_MAX_RETRIES): try: await self.client.insert_json_each_row(table, batch)