Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MVarshini committed Dec 9, 2024
1 parent 23ece7e commit 2a086b0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
6 changes: 4 additions & 2 deletions backend/app/api/v1/commons/hce.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ async def getData(
await es.close()
tasks = [item["_source"] for item in response["data"]]
jobs = pd.json_normalize(tasks)
if len(jobs) == 0:
return {"data": jobs, "total": response["total"]}

jobs[["group"]] = jobs[["group"]].fillna(0)
jobs.fillna("", inplace=True)
if len(jobs) == 0:
return {"data": jobs, "total": 0}

return {"data": jobs, "total": response["total"]}
2 changes: 1 addition & 1 deletion backend/app/api/v1/commons/ocm.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def getData(
tasks = [item["_source"] for item in response["data"]]
jobs = pd.json_normalize(tasks)
if len(jobs) == 0:
return {"data":jobs,"total": 0}
return {"data":jobs,"total": response["total"]}

if "buildUrl" not in jobs.columns:
jobs.insert(len(jobs.columns), "buildUrl", "")
Expand Down
3 changes: 2 additions & 1 deletion backend/app/api/v1/commons/ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ async def getData(
tasks = [item["_source"] for item in response["data"]]
jobs = pd.json_normalize(tasks)
if len(jobs) == 0:
return {"data": jbs, "total": 0}
return {"data": jobs, "total": response["total"]}

jobs[
["masterNodesCount", "workerNodesCount", "infraNodesCount", "totalNodesCount"]
] = jobs[
Expand Down
2 changes: 1 addition & 1 deletion backend/app/api/v1/commons/quay.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def getData(
tasks = [item["_source"] for item in response["data"]]
jobs = pd.json_normalize(tasks)
if len(jobs) == 0:
return {"data": jbs, "total": 0}
return {"data": jobs, "total": response["total"]}

jobs[
["masterNodesCount", "workerNodesCount", "infraNodesCount", "totalNodesCount"]
Expand Down
2 changes: 0 additions & 2 deletions backend/app/api/v1/commons/telco.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,5 @@ async def getData(
)

jobs = pd.json_normalize(mapped_list)
if len(jobs) == 0:
return {'data':jobs, 'total': 0}

return {"data": jobs, "total": response["total"]}

0 comments on commit 2a086b0

Please sign in to comment.