nouamanetazi HF staff commited on
Commit
0963bdd
1 Parent(s): 21ad670
Files changed (2) hide show
  1. app.py +7 -5
  2. src/utils.py +1 -1
app.py CHANGED
@@ -156,7 +156,7 @@ def display_google_sheet_tables(data_url):
156
  )
157
 
158
 
159
- def display_dataframe(df, drop_cols, data_url, search_id=True, status=False, for_help_requests=False):
160
  """Display the dataframe in a table"""
161
  col_1, col_2 = st.columns([1, 1])
162
 
@@ -207,9 +207,11 @@ def display_dataframe(df, drop_cols, data_url, search_id=True, status=False, for
207
  ]
208
 
209
  st.dataframe(display_df, height=500)
210
- st.markdown(
211
- f"To view the full Google Sheet for advanced filtering go to: {data_url} **لعرض الورقة كاملة، اذهب إلى**"
212
- )
 
 
213
  # if we want to check hidden contact information
214
  if for_help_requests:
215
  st.markdown(
@@ -476,7 +478,7 @@ drop_cols = [
476
  "VerificationStatus",
477
  "Automatic Extracted Coordinates"
478
  ]
479
- display_dataframe(verified_df, drop_cols, VERIFIED_REQUESTS_URL, search_id=True, for_help_requests=True)
480
 
481
  # Requests table
482
  st.divider()
 
156
  )
157
 
158
 
159
+ def display_dataframe(df, drop_cols, data_url, search_id=True, status=False, for_help_requests=False, show_link=True):
160
  """Display the dataframe in a table"""
161
  col_1, col_2 = st.columns([1, 1])
162
 
 
207
  ]
208
 
209
  st.dataframe(display_df, height=500)
210
+ # Original link to the Google Sheet
211
+ if show_link:
212
+ st.markdown(
213
+ f"To view the full Google Sheet for advanced filtering go to: {data_url} **لعرض الورقة كاملة، اذهب إلى**"
214
+ )
215
  # if we want to check hidden contact information
216
  if for_help_requests:
217
  st.markdown(
 
478
  "VerificationStatus",
479
  "Automatic Extracted Coordinates"
480
  ]
481
+ display_dataframe(verified_df, drop_cols, VERIFIED_REQUESTS_URL, search_id=True, for_help_requests=True, show_link=False)
482
 
483
  # Requests table
484
  st.divider()
src/utils.py CHANGED
@@ -9,7 +9,7 @@ import streamlit as st
9
  EPICENTER_LOCATION = [31.12210171476489, -8.42945837915193]
10
  BORDER_COLOR = "black"
11
 
12
- # @st.cache(persist=False) #TODO fix this
13
  def parse_gg_sheet(url):
14
  print("Parsing Google Sheet:", url)
15
  url = url.replace("edit#gid=", "export?format=csv&gid=")
 
9
  EPICENTER_LOCATION = [31.12210171476489, -8.42945837915193]
10
  BORDER_COLOR = "black"
11
 
12
+ # @st.cache_resource
13
  def parse_gg_sheet(url):
14
  print("Parsing Google Sheet:", url)
15
  url = url.replace("edit#gid=", "export?format=csv&gid=")