Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -75,9 +75,11 @@ async def on_ready():
|
|
75 |
print(f"csv successfully retrieved: \n {global_df}")
|
76 |
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
worksheet2_df =
|
|
|
|
|
81 |
|
82 |
# updates both leaderboards
|
83 |
remove_huggingfolks.start()
|
@@ -106,12 +108,7 @@ def update_google_sheet():
|
|
106 |
print(f"Google sheet {name} successfully updated at {timestamp}! \n{global_df}")
|
107 |
|
108 |
|
109 |
-
|
110 |
-
# could just do this / format
|
111 |
-
data2['discord_user_id'] = data2['discord_user_id'].astype(str)
|
112 |
-
data2['id_recover_test'] = data2['id_recover_test'].astype(str)
|
113 |
-
set_with_dataframe(worksheet2, worksheet2_df)
|
114 |
-
# very important, otherwise gspread will force format IDs in scientific notation by default (making them unusable)
|
115 |
worksheet2.format(f"E1:E{len(worksheet2_df.index)+1}", {
|
116 |
"numberFormat": {
|
117 |
"type": 'TEXT',
|
@@ -121,7 +118,15 @@ def update_google_sheet():
|
|
121 |
"numberFormat": {
|
122 |
"type": 'TEXT',
|
123 |
},
|
124 |
-
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
127 |
print(f"Google sheet {name2} successfully updated at {timestamp}!")
|
|
|
75 |
print(f"csv successfully retrieved: \n {global_df}")
|
76 |
|
77 |
|
78 |
+
|
79 |
+
worksheet2_df = data2.copy()
|
80 |
+
worksheet2_df['discord_user_id'] = worksheet2_df['discord_user_id'].astype(str)
|
81 |
+
worksheet2_df['id_recover_test'] = worksheet2_df['id_recover_test'].astype(str)
|
82 |
+
print(worksheet2_df.dtypes)
|
83 |
|
84 |
# updates both leaderboards
|
85 |
remove_huggingfolks.start()
|
|
|
108 |
print(f"Google sheet {name} successfully updated at {timestamp}! \n{global_df}")
|
109 |
|
110 |
|
111 |
+
|
|
|
|
|
|
|
|
|
|
|
112 |
worksheet2.format(f"E1:E{len(worksheet2_df.index)+1}", {
|
113 |
"numberFormat": {
|
114 |
"type": 'TEXT',
|
|
|
118 |
"numberFormat": {
|
119 |
"type": 'TEXT',
|
120 |
},
|
121 |
+
})
|
122 |
+
name2 = "hf_discord_verified_users_test"
|
123 |
+
# could just do this / format
|
124 |
+
worksheet2['discord_user_id'] = worksheet2['discord_user_id'].astype(str)
|
125 |
+
worksheet2['id_recover_test'] = worksheet2['id_recover_test'].astype(str)
|
126 |
+
print(worksheet2_df.dtypes)
|
127 |
+
set_with_dataframe(worksheet2, worksheet2_df)
|
128 |
+
# very important, otherwise gspread will force format IDs in scientific notation by default (making them unusable)
|
129 |
+
|
130 |
|
131 |
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
132 |
print(f"Google sheet {name2} successfully updated at {timestamp}!")
|