Jon Solow commited on
Commit
130c598
·
1 Parent(s): 3eebb0d

Remove page specific refresh buttons and have escape when data not yet loaded

Browse files
src/pages/7_Snap_Counts.py CHANGED
@@ -24,10 +24,9 @@ def get_page():
24
  st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
25
  common_page_config()
26
  st.title(page_title)
27
- if st.button("Refresh Data"):
28
- st.cache_data.clear()
29
  if f"snap_counts_snap_counts_{SEASON}" not in get_current_tables():
30
- st.write("Data not loaded. Check loaded data [here](./Load_Data)")
 
31
  return
32
  data, teams_list, position_list, weeks_list, data_load_time_str = load_data()
33
  st.write(f"Data loaded as of: {data_load_time_str} UTC")
 
24
  st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
25
  common_page_config()
26
  st.title(page_title)
 
 
27
  if f"snap_counts_snap_counts_{SEASON}" not in get_current_tables():
28
+ st.write("Data not loaded.")
29
+ st.write("Check loaded data [here](./Load_Data)")
30
  return
31
  data, teams_list, position_list, weeks_list, data_load_time_str = load_data()
32
  st.write(f"Data loaded as of: {data_load_time_str} UTC")
src/pages/8_FTN_Charting.py CHANGED
@@ -5,7 +5,7 @@ from config import DEFAULT_ICON
5
  from shared_page import common_page_config
6
 
7
  from queries.footballguys.constants import YEAR
8
- from queries.nflverse.github_data import get_ftn_charting
9
 
10
 
11
  @st.cache_data(ttl=60 * 60 * 24)
@@ -20,8 +20,10 @@ def get_page():
20
  st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
21
  common_page_config()
22
  st.title(page_title)
23
- if st.button("Refresh Data"):
24
- st.cache_data.clear()
 
 
25
  data, data_load_time_str = load_data()
26
  st.write(f"Data loaded as of: {data_load_time_str} UTC")
27
 
 
5
  from shared_page import common_page_config
6
 
7
  from queries.footballguys.constants import YEAR
8
+ from queries.nflverse.github_data import get_ftn_charting, get_current_tables, SEASON
9
 
10
 
11
  @st.cache_data(ttl=60 * 60 * 24)
 
20
  st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
21
  common_page_config()
22
  st.title(page_title)
23
+ if f"ftn_charting_ftn_charting_{SEASON}" not in get_current_tables():
24
+ st.write("Data not loaded.")
25
+ st.write("Check loaded data [here](./Load_Data)")
26
+ return
27
  data, data_load_time_str = load_data()
28
  st.write(f"Data loaded as of: {data_load_time_str} UTC")
29
 
src/pages/9_Team_Formations.py CHANGED
@@ -5,7 +5,7 @@ from config import DEFAULT_ICON
5
  from shared_page import common_page_config
6
 
7
  from queries.footballguys.constants import YEAR
8
- from queries.nflverse.github_data import get_pbp_participation
9
 
10
 
11
  @st.cache_data(ttl=60 * 60 * 24)
@@ -24,8 +24,10 @@ def get_page():
24
  st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
25
  common_page_config()
26
  st.title(page_title)
27
- if st.button("Refresh Data"):
28
- st.cache_data.clear()
 
 
29
  data, teams_list, data_load_time_str = load_data()
30
  st.write(f"Data loaded as of: {data_load_time_str} UTC")
31
  default_groups = [
 
5
  from shared_page import common_page_config
6
 
7
  from queries.footballguys.constants import YEAR
8
+ from queries.nflverse.github_data import get_pbp_participation, get_current_tables, SEASON
9
 
10
 
11
  @st.cache_data(ttl=60 * 60 * 24)
 
24
  st.set_page_config(page_title=page_title, page_icon=DEFAULT_ICON, layout="wide")
25
  common_page_config()
26
  st.title(page_title)
27
+ if f"ftn_charting_ftn_charting_{SEASON}" not in get_current_tables():
28
+ st.write("Data not loaded.")
29
+ st.write("Check loaded data [here](./Load_Data)")
30
+ return
31
  data, teams_list, data_load_time_str = load_data()
32
  st.write(f"Data loaded as of: {data_load_time_str} UTC")
33
  default_groups = [
src/queries/nflverse/github_data.py CHANGED
@@ -70,13 +70,6 @@ NFLVERSE_ASSETS = [
70
  ]
71
 
72
 
73
- PAGE_TO_TABLE_MAP = {
74
- "Snap_Counts": f"snap_counts_snap_counts_{SEASON}",
75
- "FTN_Charting": f"ftn_charting_ftn_charting_{SEASON}",
76
- "Team_Formations": f"pbp_participation_pbp_participation_{SEASON}",
77
- }
78
-
79
-
80
  class NflVerseDataAsset:
81
  def __init__(
82
  self,
 
70
  ]
71
 
72
 
 
 
 
 
 
 
 
73
  class NflVerseDataAsset:
74
  def __init__(
75
  self,