Skip to content

Commit ba3e2a6

Browse files
committed
fix pylint
Signed-off-by: Stephanie <yangcao@redhat.com>
1 parent 7789ae1 commit ba3e2a6

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/cache/postgres_cache.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from models.cache_entry import CacheEntry
1010
from models.config import PostgreSQLDatabaseConfiguration
1111
from models.responses import ConversationData, ReferencedDocument
12+
from utils.connection_decorator import connection
1213
from utils.types import ToolCallSummary, ToolResultSummary
1314
from log import get_logger
14-
from utils.connection_decorator import connection
1515

1616
logger = get_logger("cache.postgres_cache")
1717

@@ -227,7 +227,7 @@ def initialize_cache(self, namespace: str) -> None:
227227
self.connection.commit()
228228

229229
@connection
230-
def get(
230+
def get( # pylint: disable=R0914
231231
self, user_id: str, conversation_id: str, skip_user_id_check: bool = False
232232
) -> list[CacheEntry]:
233233
"""Get the value associated with the given key.
@@ -363,7 +363,8 @@ def insert_or_append(
363363
tool_calls_json = json.dumps(tool_calls_as_dicts)
364364
except (TypeError, ValueError) as e:
365365
logger.warning(
366-
"Failed to serialize tool_calls for " "conversation %s: %s",
366+
"Failed to serialize tool_calls for "
367+
"conversation %s: %s",
367368
conversation_id,
368369
e,
369370
)
@@ -377,7 +378,8 @@ def insert_or_append(
377378
tool_results_json = json.dumps(tool_results_as_dicts)
378379
except (TypeError, ValueError) as e:
379380
logger.warning(
380-
"Failed to serialize tool_results for " "conversation %s: %s",
381+
"Failed to serialize tool_results for "
382+
"conversation %s: %s",
381383
conversation_id,
382384
e,
383385
)

src/cache/sqlite_cache.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from models.cache_entry import CacheEntry
1111
from models.config import SQLiteDatabaseConfiguration
1212
from models.responses import ConversationData, ReferencedDocument
13+
from utils.connection_decorator import connection
1314
from utils.types import ToolCallSummary, ToolResultSummary
1415
from log import get_logger
15-
from utils.connection_decorator import connection
1616

1717
logger = get_logger("cache.sqlite_cache")
1818

@@ -194,7 +194,7 @@ def initialize_cache(self) -> None:
194194
self.connection.commit()
195195

196196
@connection
197-
def get(
197+
def get( # pylint: disable=R0914
198198
self, user_id: str, conversation_id: str, skip_user_id_check: bool = False
199199
) -> list[CacheEntry]:
200200
"""Get the value associated with the given key.
@@ -247,7 +247,8 @@ def get(
247247
]
248248
except (json.JSONDecodeError, ValueError) as e:
249249
logger.warning(
250-
"Failed to deserialize tool_calls for " "conversation %s: %s",
250+
"Failed to deserialize tool_calls for "
251+
"conversation %s: %s",
251252
conversation_id,
252253
e,
253254
)
@@ -263,7 +264,8 @@ def get(
263264
]
264265
except (json.JSONDecodeError, ValueError) as e:
265266
logger.warning(
266-
"Failed to deserialize tool_results for " "conversation %s: %s",
267+
"Failed to deserialize tool_results for "
268+
"conversation %s: %s",
267269
conversation_id,
268270
e,
269271
)
@@ -332,7 +334,8 @@ def insert_or_append(
332334
tool_calls_json = json.dumps(tool_calls_as_dicts)
333335
except (TypeError, ValueError) as e:
334336
logger.warning(
335-
"Failed to serialize tool_calls for " "conversation %s: %s",
337+
"Failed to serialize tool_calls for "
338+
"conversation %s: %s",
336339
conversation_id,
337340
e,
338341
)
@@ -346,7 +349,8 @@ def insert_or_append(
346349
tool_results_json = json.dumps(tool_results_as_dicts)
347350
except (TypeError, ValueError) as e:
348351
logger.warning(
349-
"Failed to serialize tool_results for " "conversation %s: %s",
352+
"Failed to serialize tool_results for "
353+
"conversation %s: %s",
350354
conversation_id,
351355
e,
352356
)

0 commit comments

Comments
 (0)