CognitiveScience commited on
Commit
22962df
·
1 Parent(s): 9621405

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -112,11 +112,11 @@ def run_ecs(inp):
112
  db = sqlite3.connect(DB_FILE)
113
  try:
114
  db.execute("SELECT * FROM reviews").fetchall()
115
- db.close()
116
- reviews, total_reviews = get_latest_reviews(db)
117
  except sqlite3.OperationalError:
118
  print ("db error")
119
- return (result, reviews, total_reviews)
120
 
121
 
122
  def load_data():
@@ -142,10 +142,10 @@ css="footer {visibility: hidden}"
142
  with gr.Blocks() as demo:
143
  with gr.Row():
144
  with gr.Column():
145
- total_reviews, reviews=run_ecs("Dan")
146
  df=pd.DataFrame(reviews)
147
  styler = df.style.highlight_max(color = 'lightgreen', axis = 0)
148
-
149
  gr.Dataframe(styler)
150
  #df1=run_ecs("Dan")
151
 
 
112
  db = sqlite3.connect(DB_FILE)
113
  try:
114
  db.execute("SELECT * FROM reviews").fetchall()
115
+ reviews = pd.DataFrame(reviews, columns=["id", "date_created", "name", "rate", "celsci"])
116
+ #reviews, total_reviews = get_latest_reviews(db)
117
  except sqlite3.OperationalError:
118
  print ("db error")
119
+ return (result, reviews)
120
 
121
 
122
  def load_data():
 
142
  with gr.Blocks() as demo:
143
  with gr.Row():
144
  with gr.Column():
145
+ result, reviews=run_ecs("Dan")
146
  df=pd.DataFrame(reviews)
147
  styler = df.style.highlight_max(color = 'lightgreen', axis = 0)
148
+ print(result)
149
  gr.Dataframe(styler)
150
  #df1=run_ecs("Dan")
151