Kang Suhyun suhyun.kang commited on
Commit
519572d
1 Parent(s): af115bf

[#52] Fix building leaderboard error with no battles (#53)

Browse files

This change fixes an error that occurs when the leaderboard is built with no battles.

Co-authored-by: suhyun.kang <[email protected]>

Files changed (2) hide show
  1. .gitignore +1 -1
  2. leaderboard.py +3 -0
.gitignore CHANGED
@@ -1,4 +1,4 @@
1
  venv
2
  *.log
3
  __pycache__
4
- credentials.json
 
1
  venv
2
  *.log
3
  __pycache__
4
+ credentials*.json
leaderboard.py CHANGED
@@ -64,6 +64,9 @@ def load_elo_ratings(tab):
64
  "winner": data["winner"]
65
  })
66
 
 
 
 
67
  battles = pd.DataFrame(battles)
68
  ratings = compute_elo(battles)
69
 
 
64
  "winner": data["winner"]
65
  })
66
 
67
+ if not battles:
68
+ return
69
+
70
  battles = pd.DataFrame(battles)
71
  ratings = compute_elo(battles)
72