diff --git a/backend/app.py b/backend/app.py index 49d368b..f4da070 100644 --- a/backend/app.py +++ b/backend/app.py @@ -818,7 +818,12 @@ async def get_rankings( # Return only relevant fields for rankings available_cols = [c for c in RANKING_COLUMNS if c in df.columns] - df = df[available_cols] + df = df[available_cols].copy() + + # Surface the requested metric under a stable `value` key so the + # frontend doesn't need to know each metric's column name. The raw + # metric column is also kept in the row for callers that want it. + df["value"] = df[metric] return { "metric": metric,