SwissDataScienceCenter / renku-data-services

Services that handle reading and writing data from a database
Apache License 2.0
3 stars 1 forks source link

Fix sorting of resource pools from GET `/api/data/resource_pools/` #244

Open olevski opened 1 month ago

olevski commented 1 month ago

On v0.12.0 this is the sorting that shows up image

We should sort by GPU, CPU, Ram, Disk

olevski commented 1 month ago

The current code has this in the sql query:

                .order_by(
                    schemas.ResourcePoolORM.id,
                    schemas.ResourcePoolORM.name,
                    schemas.ResourceClassORM.id,
                    schemas.ResourceClassORM.name,
                )

But then we call the unique method on the sqlalchemy result. And I think that this method messes up the ordering.