Nolwenn commited on
Commit
c9bae4b
·
1 Parent(s): f5221b6

Update Google spreadsheet connection

Browse files
Files changed (1) hide show
  1. crs_arena/utils.py +4 -1
crs_arena/utils.py CHANGED
@@ -15,7 +15,7 @@ import streamlit as st
15
  import wget
16
  import yaml
17
  from huggingface_hub import HfApi
18
- from streamlit_gsheets import GSheetsConnection
19
 
20
  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
21
 
@@ -143,6 +143,9 @@ async def upload_feedback_to_gsheet(
143
  logging.debug("Uploading feedback to Google Sheets.")
144
  try:
145
  gs_connection = st.connection("gsheets", type=GSheetsConnection)
 
 
 
146
  df = gs_connection.read(worksheet=worksheet)
147
  if df[df["id"] == row["id"]].empty:
148
  df = pd.concat([df, pd.DataFrame([row])], ignore_index=True)
 
15
  import wget
16
  import yaml
17
  from huggingface_hub import HfApi
18
+ from streamlit_gsheets import GSheetsConnection, GSheetsServiceAccountClient
19
 
20
  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
21
 
 
143
  logging.debug("Uploading feedback to Google Sheets.")
144
  try:
145
  gs_connection = st.connection("gsheets", type=GSheetsConnection)
146
+ gs_connection._instance = GSheetsServiceAccountClient(
147
+ st.secrets["gsheet"]
148
+ )
149
  df = gs_connection.read(worksheet=worksheet)
150
  if df[df["id"] == row["id"]].empty:
151
  df = pd.concat([df, pd.DataFrame([row])], ignore_index=True)