reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 44 forks source link

cli: sorting by run number behaves correctly only with lowercase column name #673

Closed giuseppe-steduto closed 8 months ago

giuseppe-steduto commented 9 months ago

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.

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: