Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,12 +78,13 @@ async def update_google_sheet():
|
|
| 78 |
worksheet = gspread_bot.open(name).sheet1
|
| 79 |
global_df['discord_user_id'] = global_df['discord_user_id'].astype(str)
|
| 80 |
set_with_dataframe(worksheet, global_df)
|
|
|
|
| 81 |
worksheet.format(f"A1:A{len(global_df.index)+1}", {
|
| 82 |
"numberFormat": {
|
| 83 |
"type": 'TEXT',
|
| 84 |
},
|
| 85 |
})
|
| 86 |
-
print(
|
| 87 |
except Exception as e:
|
| 88 |
print(f"on_message Error: {e}")
|
| 89 |
|
|
|
|
| 78 |
worksheet = gspread_bot.open(name).sheet1
|
| 79 |
global_df['discord_user_id'] = global_df['discord_user_id'].astype(str)
|
| 80 |
set_with_dataframe(worksheet, global_df)
|
| 81 |
+
# very important, otherwise gspread will force format IDs in scientific notation by default (making them unusable)
|
| 82 |
worksheet.format(f"A1:A{len(global_df.index)+1}", {
|
| 83 |
"numberFormat": {
|
| 84 |
"type": 'TEXT',
|
| 85 |
},
|
| 86 |
})
|
| 87 |
+
print(f"Google sheet {name} successfully updated! \n {global_df}")
|
| 88 |
except Exception as e:
|
| 89 |
print(f"on_message Error: {e}")
|
| 90 |
|