idolezal commited on
Commit
88fe528
1 Parent(s): e576387
Files changed (1) hide show
  1. server.py +10 -6
server.py CHANGED
@@ -138,12 +138,16 @@ class LeaderboardServer:
138
  "parameters",
139
  "win_score",
140
  ]
141
- df_order = list(dict.fromkeys(
142
- first_attributes
143
- + list(self.tasks_metadata.keys())
144
- + list(dataframe.columns)
145
- + list(extra_attributes_map_word_to_header.keys())
146
- ).keys())
 
 
 
 
147
  dataframe = dataframe[df_order]
148
  attributes_map_word_to_header = {key: value["abbreviation"] for key, value in self.tasks_metadata.items()}
149
  attributes_map_word_to_header.update(extra_attributes_map_word_to_header)
 
138
  "parameters",
139
  "win_score",
140
  ]
141
+ df_order = [
142
+ key
143
+ for key in dict.fromkeys(
144
+ first_attributes
145
+ + list(self.tasks_metadata.keys())
146
+ + list(dataframe.columns)
147
+ + list(extra_attributes_map_word_to_header.keys())
148
+ ).keys()
149
+ if key in dataframe.columns
150
+ ]
151
  dataframe = dataframe[df_order]
152
  attributes_map_word_to_header = {key: value["abbreviation"] for key, value in self.tasks_metadata.items()}
153
  attributes_map_word_to_header.update(extra_attributes_map_word_to_header)