Skip to content

Commit e2dce25

Browse files
committed
fix(transformation): adapting getTableSummaryWeb to the data access layer response
1 parent ead08ab commit e2dce25

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/DIRAC/TransformationSystem/Service/TransformationManagerHandler.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -735,17 +735,11 @@ def __getTableSummaryWeb(
735735
return res
736736

737737
# The full list of columns in contained here
738-
allRows = res["Records"]
738+
allRows = res["Value"]
739739
# Prepare the standard structure now within the resultDict dictionary
740740
resultDict = {}
741741
# Create the total records entry
742742
resultDict["TotalRecords"] = len(allRows)
743-
# Create the ParameterNames entry
744-
resultDict["ParameterNames"] = res["ParameterNames"]
745-
# Find which element in the tuple contains the requested status
746-
if statusColumn not in resultDict["ParameterNames"]:
747-
return S_ERROR("Provided status column not present")
748-
statusColumnIndex = resultDict["ParameterNames"].index(statusColumn)
749743

750744
# Get the rows which are within the selected window
751745
if resultDict["TotalRecords"] == 0:
@@ -756,13 +750,22 @@ def __getTableSummaryWeb(
756750
return S_ERROR("Item number out of range")
757751
if last > resultDict["TotalRecords"]:
758752
last = resultDict["TotalRecords"]
753+
759754
selectedRows = allRows[ini:last]
760-
resultDict["Records"] = selectedRows
755+
resultDict["Records"] = []
756+
for row in selectedRows:
757+
resultDict["Records"].append(list(row.values()))
758+
759+
# Create the ParameterNames entry
760+
resultDict["ParameterNames"] = list(selectedRows[0].keys())
761+
# Find which element in the tuple contains the requested status
762+
if statusColumn not in resultDict["ParameterNames"]:
763+
return S_ERROR("Provided status column not present")
761764

762765
# Generate the status dictionary
763766
statusDict = {}
764767
for row in selectedRows:
765-
status = row[statusColumnIndex]
768+
status = row[statusColumn]
766769
statusDict[status] = statusDict.setdefault(status, 0) + 1
767770
resultDict["Extras"] = statusDict
768771

0 commit comments

Comments
 (0)