Skip to content

Commit

Permalink
chore: sort nulls last in experiment trial API (#2329) [DET-5300]
Browse files Browse the repository at this point in the history
This change updates the GET experiment trials API to sort trials with total_batches_processed = 0 correctly.
  • Loading branch information
stoksc authored May 4, 2021
1 parent cfb46ab commit dca96c2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions master/static/srv/proto_get_trial_ids_for_experiment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ WITH searcher_info AS (
t.end_time,
coalesce(t.end_time, now()) - t.start_time AS duration,
(
SELECT s.total_batches
SELECT coalesce(max(s.total_batches), 0)
FROM steps s
WHERE s.trial_id = t.id
AND s.state = 'COMPLETED'
ORDER BY s.id DESC
LIMIT 1
WHERE s.trial_id = t.id AND s.state = 'COMPLETED'
) AS total_batches_processed,
(
CASE WHEN t.best_validation_id IS NOT NULL THEN
Expand Down

0 comments on commit dca96c2

Please sign in to comment.