zhimin-z commited on
Commit
edbc9fd
·
1 Parent(s): b7544c6
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -532,6 +532,15 @@ def get_leaderboard_dataframe():
532
  if "Total PRs" in df.columns and not df.empty:
533
  df = df.sort_values(by="Total PRs", ascending=False).reset_index(drop=True)
534
 
 
 
 
 
 
 
 
 
 
535
  print(f"Final DataFrame shape: {df.shape}")
536
  print("="*60 + "\n")
537
 
 
532
  if "Total PRs" in df.columns and not df.empty:
533
  df = df.sort_values(by="Total PRs", ascending=False).reset_index(drop=True)
534
 
535
+ # Workaround for gradio_leaderboard bug: single-row tables don't render properly
536
+ # Add a placeholder row when there's only 1 record
537
+ if len(df) == 1:
538
+ placeholder_row = pd.DataFrame([[
539
+ "Submit yours to join!", "—", 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0
540
+ ]], columns=df.columns)
541
+ df = pd.concat([df, placeholder_row], ignore_index=True)
542
+ print("Added placeholder row for single-record workaround")
543
+
544
  print(f"Final DataFrame shape: {df.shape}")
545
  print("="*60 + "\n")
546