jasonshaoshun commited on
Commit
28169bd
·
1 Parent(s): 56d1796
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -120,20 +120,25 @@ def init_leaderboard_mib_subgraph(dataframe, track):
120
  )
121
 
122
  def init_leaderboard_mib_causalgraph(dataframe, track):
123
- print(f"init_leaderboard_mib: dataframe head before loc is {dataframe.head()}\n")
 
124
 
125
  if dataframe is None or dataframe.empty:
126
  raise ValueError("Leaderboard DataFrame is empty or None.")
127
 
128
- # Print all columns for debugging
129
- print("Available columns in dataframe:", dataframe.columns.tolist())
130
- print("Expected columns from AutoEvalColumn_mib_causalgraph:", [c.name for c in fields(AutoEvalColumn_mib_causalgraph) if not c.hidden])
131
 
132
- # Remove this line since we don't need track filtering for causalgraph
133
- # dataframe = dataframe.loc[dataframe["Track"] == track]
134
-
135
- print(f"init_leaderboard_mib: dataframe head after loc is {dataframe.head()}\n")
136
 
 
 
 
 
137
  return Leaderboard(
138
  value=dataframe,
139
  datatype=[c.type for c in fields(AutoEvalColumn_mib_causalgraph)],
 
120
  )
121
 
122
  def init_leaderboard_mib_causalgraph(dataframe, track):
123
+ print("init_leaderboard_mib: starting...")
124
+ print(f"DataFrame columns after entering function: {dataframe.columns.tolist()}")
125
 
126
  if dataframe is None or dataframe.empty:
127
  raise ValueError("Leaderboard DataFrame is empty or None.")
128
 
129
+ # Let's check our expected columns
130
+ expected_cols = [c.name for c in fields(AutoEvalColumn_mib_causalgraph)]
131
+ print(f"Expected columns: {expected_cols}")
132
 
133
+ # Check if every expected column exists
134
+ missing_cols = [col for col in expected_cols if col not in dataframe.columns]
135
+ if missing_cols:
136
+ print(f"Missing columns: {missing_cols}")
137
 
138
+ # Print first few rows to see the data structure
139
+ print("\nFirst few rows of DataFrame:")
140
+ print(dataframe.head().to_string())
141
+
142
  return Leaderboard(
143
  value=dataframe,
144
  datatype=[c.type for c in fields(AutoEvalColumn_mib_causalgraph)],