Skip to content

Commit c05d7d2

Browse files
Merge pull request #308 from microsoft/dev
chore: Merge Dev to Main
2 parents 75f2959 + fc05e6e commit c05d7d2

24 files changed

Lines changed: 68 additions & 152 deletions

File tree

.github/workflows/build-docker-images.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ on:
77
- dev
88
- demo
99
- hotfix
10+
paths:
11+
- 'src/backend/**'
12+
- 'src/frontend/**'
13+
- 'docker/**'
14+
- '.github/workflows/build-docker-images.yml'
15+
- '.github/workflows/build-docker.yml'
16+
- 'infra/**'
17+
- 'scripts/**'
18+
- 'azure.yaml'
19+
- '.github/workflows/deploy.yml'
1020
pull_request:
1121
branches:
1222
- main
@@ -18,6 +28,16 @@ on:
1828
- ready_for_review
1929
- reopened
2030
- synchronize
31+
paths:
32+
- 'src/backend/**'
33+
- 'src/frontend/**'
34+
- 'docker/**'
35+
- '.github/workflows/build-docker-images.yml'
36+
- '.github/workflows/build-docker.yml'
37+
- 'infra/**'
38+
- 'scripts/**'
39+
- 'azure.yaml'
40+
- '.github/workflows/deploy.yml'
2141
merge_group:
2242
workflow_dispatch:
2343

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,4 @@ jobs:
438438
if: always()
439439
run: |
440440
az logout
441-
echo "Logged out from Azure."
441+
echo "Logged out from Azure."

.github/workflows/pylint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: PyLint
22

3-
on: [push]
3+
on:
4+
push:
5+
paths:
6+
- '**/*.py'
7+
- '**/requirements.txt'
8+
- '**/pyproject.toml'
9+
- '.flake8'
10+
- '.github/workflows/pylint.yml'
411

512
jobs:
613
lint:

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
- main
77
- dev
88
- demo
9+
paths:
10+
- 'src/backend/**/*.py'
11+
- 'src/tests/backend/**'
12+
- '.github/workflows/test.yml'
13+
- 'src/backend/requirements.txt'
14+
- 'src/frontend/requirements.txt'
15+
- 'src/backend/pyproject.toml'
916
pull_request:
1017
types:
1118
- opened
@@ -16,6 +23,13 @@ on:
1623
- main
1724
- dev
1825
- demo
26+
paths:
27+
- 'src/backend/**/*.py'
28+
- 'src/tests/backend/**'
29+
- '.github/workflows/test.yml'
30+
- 'src/backend/requirements.txt'
31+
- 'src/frontend/requirements.txt'
32+
- 'src/backend/pyproject.toml'
1933

2034
jobs:
2135
# frontend_tests:

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/database/cosmosdb.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,6 @@ async def update_batch_entry(
352352
batch["file_count"] = file_count
353353

354354
await self.batch_container.replace_item(item=batch_id, body=batch)
355-
# if isinstance(status, ProcessStatus):
356-
# self.logger.info(f"Updated batch {batch_id} to status {status.value}")
357-
# else:
358-
# self.logger.info(f"Updated batch {batch_id} to status {status}")
359355

360356
return batch
361357
except Exception as e:

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/common/storage/blob_azure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def upload_file(
5252
raise
5353
try:
5454
# Upload the file
55-
upload_results = blob_client.upload_blob( # noqa: F841
55+
blob_client.upload_blob(
5656
file_content,
5757
content_type=content_type,
5858
metadata=metadata,

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);

0 commit comments

Comments
 (0)