Spaces:
Running
Running
leaderboard: catch only network errors (RequestException), not all exceptions
Browse files
app.py
CHANGED
|
@@ -126,12 +126,14 @@ def leaderboard() -> pd.DataFrame:
|
|
| 126 |
joined from the task registry at read time; if that fetch fails the board
|
| 127 |
renders empty rather than showing a wrong ranking.
|
| 128 |
"""
|
|
|
|
|
|
|
| 129 |
try:
|
| 130 |
df = _read_results()
|
| 131 |
datasets = manifest_ids(fetch_manifest(TOKEN))
|
| 132 |
registry = scoreable_tasks(fetch_tasks_registry(TOKEN), datasets)
|
| 133 |
by_id = {_norm_id(task["task_id"]): task for task in registry}
|
| 134 |
-
except
|
| 135 |
return pd.DataFrame(columns=BASE_COLUMNS)
|
| 136 |
required = set(by_id)
|
| 137 |
if df.empty or not required:
|
|
|
|
| 126 |
joined from the task registry at read time; if that fetch fails the board
|
| 127 |
renders empty rather than showing a wrong ranking.
|
| 128 |
"""
|
| 129 |
+
from requests.exceptions import RequestException
|
| 130 |
+
|
| 131 |
try:
|
| 132 |
df = _read_results()
|
| 133 |
datasets = manifest_ids(fetch_manifest(TOKEN))
|
| 134 |
registry = scoreable_tasks(fetch_tasks_registry(TOKEN), datasets)
|
| 135 |
by_id = {_norm_id(task["task_id"]): task for task in registry}
|
| 136 |
+
except RequestException:
|
| 137 |
return pd.DataFrame(columns=BASE_COLUMNS)
|
| 138 |
required = set(by_id)
|
| 139 |
if df.empty or not required:
|