Skip to content

Commit 5855a63

Browse files
author
Shreyas-Microsoft
committed
fix pylint
1 parent a3da8ff commit 5855a63

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

src/backend/sql_agents/convert_script.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
and updates the database with the results.
55
"""
66

7-
import asyncio
87
import json
98
import logging
109

@@ -45,8 +44,8 @@ async def convert_script(
4544
logger.info("Migrating query: %s\n", source_script)
4645

4746
# Setup the group chat for the agents
48-
chat = CommsManager(sql_agents.idx_agents).group_chat
49-
#retry logic comms manager
47+
# chat = CommsManager(sql_agents.idx_agents).group_chat
48+
# retry logic comms manager
5049
comms_manager = CommsManager(
5150
sql_agents.idx_agents,
5251
max_retries=5, # Retry up to 5 times for rate limits
@@ -216,7 +215,7 @@ async def convert_script(
216215
# ),
217216
# )
218217
# Safely parse response content to avoid crashing on malformed or incomplete JSON
219-
#start
218+
# start
220219
try:
221220
parsed_content = json.loads(response.content or "{}")
222221
except json.JSONDecodeError:
@@ -240,7 +239,7 @@ async def convert_script(
240239
FileResult.INFO,
241240
),
242241
)
243-
##end
242+
# end
244243
await batch_service.create_file_log(
245244
str(file.file_id),
246245
description,
@@ -250,7 +249,7 @@ async def convert_script(
250249
AuthorRole(response.role),
251250
)
252251
except Exception as e:
253-
#logger.error("Error during chat.invoke(): %s", str(e))
252+
# logger.error("Error during chat.invoke(): %s", str(e))
254253
logger.error("Error during comms_manager.async_invoke(): %s", str(e))
255254
# Log the error to the batch service for tracking
256255
await batch_service.create_file_log(
@@ -356,4 +355,4 @@ async def validate_migration(
356355
author_role=AuthorRole.ASSISTANT,
357356
)
358357

359-
return True
358+
return True

src/backend/sql_agents/helpers/comms_manager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async def should_agent_terminate(self, agent, history):
115115
return terminate
116116

117117
def __init__(
118-
self,
118+
self,
119119
agent_dict,
120120
exception_types: tuple = (Exception,),
121121
max_retries: int = 10,
@@ -124,7 +124,7 @@ def __init__(
124124
simple_truncation: int = None,
125125
):
126126
"""Initialize the CommsManager and agent_chat with the given agents.
127-
127+
128128
Args:
129129
agent_dict: Dictionary of agents
130130
exception_types: Tuple of exception types that should trigger a retry
@@ -139,7 +139,7 @@ def __init__(
139139
self.backoff_factor = backoff_factor
140140
self.exception_types = exception_types
141141
self.simple_truncation = simple_truncation
142-
142+
143143
# Initialize the group chat (maintaining original functionality)
144144
self.group_chat = AgentGroupChat(
145145
agents=agent_dict.values(),
@@ -168,12 +168,12 @@ async def async_invoke(self) -> AsyncIterable[ChatMessageContent]:
168168
# Grab a snapshot of the history of the group chat
169169
# Using copy to avoid getting a reference to the original list
170170
history_snap = copy.deepcopy(self.group_chat.history)
171-
171+
172172
self.logger.debug(
173173
"History before invoke: %s",
174174
[msg.name for msg in self.group_chat.history],
175175
)
176-
176+
177177
# Get a fresh iterator from the function
178178
async_iter = self.group_chat.invoke()
179179

@@ -257,4 +257,4 @@ async def async_invoke(self) -> AsyncIterable[ChatMessageContent]:
257257
)
258258

259259
await asyncio.sleep(current_delay)
260-
current_delay *= self.backoff_factor
260+
current_delay *= self.backoff_factor

src/backend/sql_agents/process_batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def process_batch_async(
131131
else:
132132
await batch_service.update_file_counts(file["file_id"])
133133
# TEMPORARY: awaiting bug fix for rate limits
134-
#await asyncio.sleep(5)
134+
# await asyncio.sleep(5)
135135
except UnicodeDecodeError as ucde:
136136
logger.error("Error decoding file: %s", file)
137137
logger.error("Error decoding file. %s", ucde)

0 commit comments

Comments
 (0)