Spaces:
Running
Running
James McCool
commited on
Commit
·
1be941a
1
Parent(s):
746e1c2
adding session state and cache clearing
Browse files
app.py
CHANGED
|
@@ -166,9 +166,15 @@ with tab1:
|
|
| 166 |
if response.status_code == 200:
|
| 167 |
st.write("Uploading!")
|
| 168 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 169 |
else:
|
| 170 |
st.write("Error uploading seasonal rankings")
|
| 171 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
with col2:
|
| 174 |
st.info("Update Weekly Rankings")
|
|
@@ -179,9 +185,15 @@ with tab1:
|
|
| 179 |
if response.status_code == 200:
|
| 180 |
st.write("Uploading!")
|
| 181 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 182 |
else:
|
| 183 |
st.write("Error uploading weekly rankings")
|
| 184 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
with col3:
|
| 187 |
st.info("Update Seasonal Guillotine Rankings")
|
|
@@ -192,9 +204,15 @@ with tab1:
|
|
| 192 |
if response.status_code == 200:
|
| 193 |
st.write("Uploading!")
|
| 194 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 195 |
else:
|
| 196 |
st.write("Error uploading seasonal guillotine rankings")
|
| 197 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
with col4:
|
| 200 |
st.info("Update Weekly Guillotine Rankings")
|
|
@@ -205,9 +223,15 @@ with tab1:
|
|
| 205 |
if response.status_code == 200:
|
| 206 |
st.write("Uploading!")
|
| 207 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 208 |
else:
|
| 209 |
st.write("Error uploading weekly guillotine rankings")
|
| 210 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
|
| 213 |
|
|
@@ -224,12 +248,24 @@ with tab2:
|
|
| 224 |
if response.status_code == 200:
|
| 225 |
st.write("Uploading!")
|
| 226 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
response = requests.post(f"https://api.fantasylife.com/api/projections/v1/aggregate/seasonal/update", headers=headers)
|
| 228 |
if response.status_code == 200:
|
| 229 |
st.write("Uploading Aggregate as well.")
|
| 230 |
else:
|
| 231 |
st.write("Error uploading seasonal aggregate projections")
|
| 232 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 233 |
with col2:
|
| 234 |
st.info("Update Weekly Projections")
|
| 235 |
choose_weekly_type = st.selectbox("Choose Type", proj_source_options, key='weekly_type')
|
|
@@ -239,15 +275,24 @@ with tab2:
|
|
| 239 |
if response.status_code == 200:
|
| 240 |
st.write("Uploading!")
|
| 241 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 242 |
else:
|
| 243 |
st.write("Error uploading weekly projections")
|
| 244 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 245 |
response = requests.post(f"https://api.fantasylife.com/api/projections/v1/aggregate/weekly/update", headers=headers)
|
| 246 |
if response.status_code == 200:
|
| 247 |
st.write("Uploading Aggregate as well.")
|
| 248 |
else:
|
| 249 |
st.write("Error uploading weekly aggregate projections")
|
| 250 |
st.write(response.json())
|
|
|
|
|
|
|
|
|
|
| 251 |
|
| 252 |
with tab3:
|
| 253 |
with st.container():
|
|
|
|
| 166 |
if response.status_code == 200:
|
| 167 |
st.write("Uploading!")
|
| 168 |
st.write(response.json())
|
| 169 |
+
st.cache_data.clear()
|
| 170 |
+
for key in st.session_state.keys():
|
| 171 |
+
del st.session_state[key]
|
| 172 |
else:
|
| 173 |
st.write("Error uploading seasonal rankings")
|
| 174 |
st.write(response.json())
|
| 175 |
+
st.cache_data.clear()
|
| 176 |
+
for key in st.session_state.keys():
|
| 177 |
+
del st.session_state[key]
|
| 178 |
|
| 179 |
with col2:
|
| 180 |
st.info("Update Weekly Rankings")
|
|
|
|
| 185 |
if response.status_code == 200:
|
| 186 |
st.write("Uploading!")
|
| 187 |
st.write(response.json())
|
| 188 |
+
st.cache_data.clear()
|
| 189 |
+
for key in st.session_state.keys():
|
| 190 |
+
del st.session_state[key]
|
| 191 |
else:
|
| 192 |
st.write("Error uploading weekly rankings")
|
| 193 |
st.write(response.json())
|
| 194 |
+
st.cache_data.clear()
|
| 195 |
+
for key in st.session_state.keys():
|
| 196 |
+
del st.session_state[key]
|
| 197 |
|
| 198 |
with col3:
|
| 199 |
st.info("Update Seasonal Guillotine Rankings")
|
|
|
|
| 204 |
if response.status_code == 200:
|
| 205 |
st.write("Uploading!")
|
| 206 |
st.write(response.json())
|
| 207 |
+
st.cache_data.clear()
|
| 208 |
+
for key in st.session_state.keys():
|
| 209 |
+
del st.session_state[key]
|
| 210 |
else:
|
| 211 |
st.write("Error uploading seasonal guillotine rankings")
|
| 212 |
st.write(response.json())
|
| 213 |
+
st.cache_data.clear()
|
| 214 |
+
for key in st.session_state.keys():
|
| 215 |
+
del st.session_state[key]
|
| 216 |
|
| 217 |
with col4:
|
| 218 |
st.info("Update Weekly Guillotine Rankings")
|
|
|
|
| 223 |
if response.status_code == 200:
|
| 224 |
st.write("Uploading!")
|
| 225 |
st.write(response.json())
|
| 226 |
+
st.cache_data.clear()
|
| 227 |
+
for key in st.session_state.keys():
|
| 228 |
+
del st.session_state[key]
|
| 229 |
else:
|
| 230 |
st.write("Error uploading weekly guillotine rankings")
|
| 231 |
st.write(response.json())
|
| 232 |
+
st.cache_data.clear()
|
| 233 |
+
for key in st.session_state.keys():
|
| 234 |
+
del st.session_state[key]
|
| 235 |
|
| 236 |
|
| 237 |
|
|
|
|
| 248 |
if response.status_code == 200:
|
| 249 |
st.write("Uploading!")
|
| 250 |
st.write(response.json())
|
| 251 |
+
st.cache_data.clear()
|
| 252 |
+
for key in st.session_state.keys():
|
| 253 |
+
del st.session_state[key]
|
| 254 |
+
else:
|
| 255 |
+
st.write("Error uploading seasonal aggregate projections")
|
| 256 |
+
st.write(response.json())
|
| 257 |
+
st.cache_data.clear()
|
| 258 |
+
for key in st.session_state.keys():
|
| 259 |
+
del st.session_state[key]
|
| 260 |
response = requests.post(f"https://api.fantasylife.com/api/projections/v1/aggregate/seasonal/update", headers=headers)
|
| 261 |
if response.status_code == 200:
|
| 262 |
st.write("Uploading Aggregate as well.")
|
| 263 |
else:
|
| 264 |
st.write("Error uploading seasonal aggregate projections")
|
| 265 |
st.write(response.json())
|
| 266 |
+
st.cache_data.clear()
|
| 267 |
+
for key in st.session_state.keys():
|
| 268 |
+
del st.session_state[key]
|
| 269 |
with col2:
|
| 270 |
st.info("Update Weekly Projections")
|
| 271 |
choose_weekly_type = st.selectbox("Choose Type", proj_source_options, key='weekly_type')
|
|
|
|
| 275 |
if response.status_code == 200:
|
| 276 |
st.write("Uploading!")
|
| 277 |
st.write(response.json())
|
| 278 |
+
st.cache_data.clear()
|
| 279 |
+
for key in st.session_state.keys():
|
| 280 |
+
del st.session_state[key]
|
| 281 |
else:
|
| 282 |
st.write("Error uploading weekly projections")
|
| 283 |
st.write(response.json())
|
| 284 |
+
st.cache_data.clear()
|
| 285 |
+
for key in st.session_state.keys():
|
| 286 |
+
del st.session_state[key]
|
| 287 |
response = requests.post(f"https://api.fantasylife.com/api/projections/v1/aggregate/weekly/update", headers=headers)
|
| 288 |
if response.status_code == 200:
|
| 289 |
st.write("Uploading Aggregate as well.")
|
| 290 |
else:
|
| 291 |
st.write("Error uploading weekly aggregate projections")
|
| 292 |
st.write(response.json())
|
| 293 |
+
st.cache_data.clear()
|
| 294 |
+
for key in st.session_state.keys():
|
| 295 |
+
del st.session_state[key]
|
| 296 |
|
| 297 |
with tab3:
|
| 298 |
with st.container():
|