chore: fix limit 0 for /api/v1/trials/:id/workloads
The workloads API shimmed limit 0 to limit NULL, but `public.page_info`
does not know how to handle NULL inputs. This changed shims it,
instead, to the value for "give me everything".
@@ -28,6 +28,7 @@ import (
"github.com/determined-ai/determined/master/pkg/protoutils"
"github.com/determined-ai/determined/master/pkg/protoutils/protoconverter"
"github.com/determined-ai/determined/master/pkg/protoutils/protoless"
+ "github.com/determined-ai/determined/master/pkg/ptrs"
"github.com/determined-ai/determined/master/pkg/searcher"
"github.com/determined-ai/determined/proto/pkg/apiv1"
"github.com/determined-ai/determined/proto/pkg/checkpointv1"
@@ -614,7 +615,7 @@ func (a *apiServer) GetTrialWorkloads(_ context.Context, req *apiv1.GetTrialWork
resp := &apiv1.GetTrialWorkloadsResponse{}
limit := &req.Limit
if *limit == 0 {
- limit = nil
+ limit = ptrs.Ptr[int32](-1)
}
sortCode := "total_batches"
