From 3950785c9cd5b707875dba10d43d7ff5df18728b Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:56:37 +0200 Subject: [PATCH] Sort null size values accordingly --- lib/galaxy/managers/hdas.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/managers/hdas.py b/lib/galaxy/managers/hdas.py index 17abe5063337..09354dd71ebc 100644 --- a/lib/galaxy/managers/hdas.py +++ b/lib/galaxy/managers/hdas.py @@ -21,6 +21,8 @@ desc, false, func, + nulls_first, + nulls_last, select, true, ) @@ -347,8 +349,8 @@ def __init__(self, hda_manager: HDAManager, dataset_manager: datasets.DatasetMan self.sort_map = { StoredItemOrderBy.NAME_ASC: asc(model.HistoryDatasetAssociation.name), StoredItemOrderBy.NAME_DSC: desc(model.HistoryDatasetAssociation.name), - StoredItemOrderBy.SIZE_ASC: asc(model.Dataset.total_size), - StoredItemOrderBy.SIZE_DSC: desc(model.Dataset.total_size), + StoredItemOrderBy.SIZE_ASC: nulls_first(asc(model.Dataset.total_size)), + StoredItemOrderBy.SIZE_DSC: nulls_last(desc(model.Dataset.total_size)), StoredItemOrderBy.UPDATE_TIME_ASC: asc(model.HistoryDatasetAssociation.update_time), StoredItemOrderBy.UPDATE_TIME_DSC: desc(model.HistoryDatasetAssociation.update_time), }