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), }