Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions queries/evaluation_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@ async def get_evaluation_set_score_stats(conn: DatabaseConnection, set_id: int)
- agents_beating_previous_best: The count of agents in the current set that beat the previous best score.
"""
return await conn.fetchrow(
"""
WITH prev_best AS (
f"""
WITH {_SQL_SET_WINDOW_CTE},
{_sql_agents_in_window_cte("a.agent_id, a.status")},
prev_best AS (
SELECT
MAX(final_score) AS score
FROM
Expand Down Expand Up @@ -471,15 +473,11 @@ async def get_evaluation_set_score_stats(conn: DatabaseConnection, set_id: int)
) :: int AS agents_beating_previous_best
FROM
agent_scores s
JOIN agents_in_window aiw ON aiw.agent_id = s.agent_id
WHERE
s.set_id = $1
AND s.agent_id NOT IN (
SELECT
agent_id
FROM
benchmark_agent_ids
)
AND s.status = 'finished'
AND aiw.status = 'finished'
AND NOT aiw.disqualified
""",
set_id,
)
Expand Down
Loading