Nolwenn commited on
Commit
4931dff
·
1 Parent(s): 93f3b22

Update Google spreadsheet connection

Browse files
Files changed (1) hide show
  1. crs_arena/utils.py +2 -5
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, GSheetsServiceAccountClient
19
 
20
  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
21
 
@@ -144,10 +144,7 @@ async def upload_feedback_to_gsheet(
144
  """
145
  logging.debug("Uploading feedback to Google Sheets.")
146
  try:
147
- gs_connection = st.connection("gsheets", type=GSheetsConnection)
148
- gs_connection._instance = GSheetsServiceAccountClient(
149
- st.secrets["gsheet"]
150
- )
151
  df = gs_connection.read(worksheet=worksheet)
152
  if df[df["id"] == row["id"]].empty:
153
  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.gsheets_connection import GSheetsServiceAccountClient
19
 
20
  sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
21
 
 
144
  """
145
  logging.debug("Uploading feedback to Google Sheets.")
146
  try:
147
+ gs_connection = GSheetsServiceAccountClient(st.secrets["gsheet"])
 
 
 
148
  df = gs_connection.read(worksheet=worksheet)
149
  if df[df["id"] == row["id"]].empty:
150
  df = pd.concat([df, pd.DataFrame([row])], ignore_index=True)