Skip to content

Commit bab02b3

Browse files
Updated the others files with minor changes
1 parent e35f862 commit bab02b3

8 files changed

Lines changed: 12 additions & 24 deletions

File tree

src/backend/api/api_routes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ async def batch_status_updates(
279279
try:
280280
await websocket.receive_text()
281281
except asyncio.TimeoutError:
282+
# TimeoutError is ignored to keep the WebSocket connection open without receiving data
282283
pass
283284

284285
except WebSocketDisconnect:

src/backend/common/services/batch_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ async def delete_batch(self, batch_id: UUID, user_id: str):
175175

176176
self.logger.info(f"Successfully deleted batch with ID: {batch_id}")
177177
return {"message": "Batch deleted successfully", "batch_id": str(batch_id)}
178+
else:
179+
return {"message": "Batch not found", "batch_id": str(batch_id)}
178180

179181
async def delete_file(self, file_id: UUID, user_id: str):
180182
"""Delete a file and its logs, and update batch file count."""

src/backend/sql_agents/helpers/comms_manager.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,3 @@ async def cleanup(self):
270270

271271
except Exception as e:
272272
self.logger.error("Error during cleanup: %s", str(e))
273-
274-
def __del__(self):
275-
"""Destructor to ensure cleanup if not explicitly called."""
276-
try:
277-
# Only attempt cleanup if there's an active event loop
278-
loop = asyncio.get_running_loop()
279-
if loop and not loop.is_closed():
280-
# Schedule cleanup as a task
281-
loop.create_task(self.cleanup())
282-
except RuntimeError:
283-
# No event loop running, can't clean up asynchronously
284-
self.logger.warning("No event loop available for cleanup in destructor")
285-
except Exception as e:
286-
self.logger.error("Error in destructor cleanup: %s", str(e))

src/backend/sql_agents/tools/src/Program.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Linq;
45
using Microsoft.SqlServer.TransactSql.ScriptDom;
56
using Newtonsoft.Json;
67

@@ -42,18 +43,14 @@ static void Main(string[] args)
4243

4344
IList<ParseError> errors = ParseSqlQuery(sqlQuery);
4445

45-
var errorList = new List<Dictionary<string, object>>();
46-
47-
foreach (var error in errors)
48-
{
49-
var errorDict = new Dictionary<string, object>
46+
var errorList = errors
47+
.Select(error => new Dictionary<string, object>
5048
{
5149
{ "Line", error.Line },
5250
{ "Column", error.Column },
5351
{ "Error", error.Message }
54-
};
55-
errorList.Add(errorDict);
56-
}
52+
})
53+
.ToList();
5754

5855
string jsonOutput = JsonConvert.SerializeObject(errorList, Formatting.Indented);
5956
Console.WriteLine(jsonOutput);

src/frontend/frontend_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from dotenv import load_dotenv
55
from fastapi import FastAPI
66
from fastapi.middleware.cors import CORSMiddleware
7-
from fastapi.responses import FileResponse, HTMLResponse
7+
from fastapi.responses import FileResponse
88
from fastapi.staticfiles import StaticFiles
99

1010
# Load environment variables from .env file

tests/e2e-test/pages/HomePage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class HomePage(BasePage):
1919
FILE_PROCESSED_MSG = "//span[normalize-space()='3 files processed successfully']"
2020

2121
def __init__(self, page):
22+
super().__init__(page)
2223
self.page = page
2324

2425
def validate_home_page(self):

tests/e2e-test/pages/loginPage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class LoginPage(BasePage):
1111
PERMISSION_ACCEPT_BUTTON = "//input[@type='submit']"
1212

1313
def __init__(self, page):
14+
super().__init__()
1415
self.page = page
1516

1617
def authenticate(self, username, password):

tests/e2e-test/tests/test_codegen_gp_tc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
("01. Validate home page is loaded", lambda home: home.validate_home_page()),
1313
("02. Validate Upload of other than SQL files", lambda home: home.upload_unsupported_files()),
1414
("03. Validate Upload input files for SQL only", lambda home: home.upload_files()),
15-
("04. Validate translation process for uploaded files", lambda home: _timed_translation(home)),
15+
("04. Validate translation process for uploaded files", _timed_translation),
1616
("05. Check batch history", lambda home: home.validate_batch_history()),
1717
("06. Download all files and return home", lambda home: home.validate_download_files()),
1818
]

0 commit comments

Comments
 (0)