diff --git a/src/DIRAC/TransformationSystem/Client/TransformationClient.py b/src/DIRAC/TransformationSystem/Client/TransformationClient.py index 3710e25df53..7f1b7daa81a 100644 --- a/src/DIRAC/TransformationSystem/Client/TransformationClient.py +++ b/src/DIRAC/TransformationSystem/Client/TransformationClient.py @@ -179,12 +179,14 @@ def getTransformationFiles( res = rpcClient.getTransformationFiles( condDict, older, newer, timeStamp, orderAttribute, offset, maxfiles, columns ) + # TransformationDB.getTransformationFiles includes a "Records"/"ParameterNames" + # that we don't want to return to the client so explicitly return S_OK with the value if not res["OK"]: return res return S_OK(res["Value"]) - # If LFNs requested continue to do the old behavior of requesting in small batches - # Probably not needed? + # If LFNs requested, request in small batches, because... + # Probably not needed? Because this should always be a list if isinstance(condDict["LFN"], str): lfnList = [condDict["LFN"]] else: diff --git a/src/DIRAC/TransformationSystem/DB/TransformationDB.py b/src/DIRAC/TransformationSystem/DB/TransformationDB.py index 634bfaa487c..aaf054156cb 100755 --- a/src/DIRAC/TransformationSystem/DB/TransformationDB.py +++ b/src/DIRAC/TransformationSystem/DB/TransformationDB.py @@ -628,7 +628,7 @@ def getTransformationFiles( else: return S_ERROR(f"Invalid key {key} in condDict") if timeStamp: - timeStamp = f"t.{timeStamp}" + timeStamp = f"tf.{timeStamp}" if fixedCondDict or older or newer: cond = self.buildCondition(fixedCondDict, older, newer, timeStamp, orderAttribute, limit, offset=offset) # When buildCondition tries to quote the column names, it will fail due to the table alias diff --git a/tests/Integration/TransformationSystem/Test_Client_Transformation.py b/tests/Integration/TransformationSystem/Test_Client_Transformation.py index 3cf1287253c..710ce4ff061 100644 --- a/tests/Integration/TransformationSystem/Test_Client_Transformation.py +++ b/tests/Integration/TransformationSystem/Test_Client_Transformation.py @@ -114,6 +114,17 @@ def test_addTasksAndFiles(self): for f in res["Value"]: self.assertEqual(f["Status"], TransformationFilesStatus.ASSIGNED) + # make sure we can selectively select LFNs + res = self.transClient.getTransformationFiles({"TransformationID": transID, "LFN": ["/aa/lfn.1.txt"]}) + assert res["OK"], res + assert len(res["Value"]) == 1, res + assert "TargetSE" in res["Value"][0].keys(), res + + # make sure we can selectively select columns + res = self.transClient.getTransformationFiles({"TransformationID": transID}, columns=["LFN", "Status"]) + assert res["OK"], res + assert sorted(res["Value"][0]) == ["LFN", "Status"], res + # now adding a new Transformation with new tasks, and introducing a mix of insertion, # to test that the trigger works as it should res = self.transClient.addTransformation(