In #619, we solved the reana-client list issue of incorrectly sorting the workflow list by run number, because the run number was considered as a string, and thus 2 came after 178.
However, the fix only works when the column name is specified in lowercase: IOW, reana-client list --sort run_number works, but reana-client list --sort RUN_NUMBER does not. The other sorting keys appear to work fine in both uppercase and lowercase.
In #619, we solved the
reana-client list
issue of incorrectly sorting the workflow list by run number, because the run number was considered as a string, and thus2
came after178
. However, the fix only works when the column name is specified in lowercase: IOW,reana-client list --sort run_number
works, butreana-client list --sort RUN_NUMBER
does not. The other sorting keys appear to work fine in both uppercase and lowercase.This is because in the case of the run number, the sorting key is overridden only when the column name passed by the user as an argument is lowercase: https://github.com/reanahub/reana-client/blob/9c94abed31f522a1ff01bd64abd7975b4c675980/reana_client/cli/workflow.py#L273-L287
We can solve this quickly by:
get_sort_key
function so that it takes the column name from thecolumn_id
argumentget_sort_key
function so that it converts the column name to lowercase before comparing it torun_number