Spaces:
Runtime error
Runtime error
CognitiveScience
commited on
Commit
•
03e689c
1
Parent(s):
0d6dac3
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ repo = huggingface_hub.Repository(
|
|
29 |
repo.git_pull()
|
30 |
|
31 |
# Set db to latest
|
32 |
-
shutil.copyfile("./data/reviews.db", DB_FILE)
|
33 |
|
34 |
# Create table if it doesn't already exist
|
35 |
|
@@ -48,7 +48,7 @@ except sqlite3.OperationalError:
|
|
48 |
db.close()
|
49 |
|
50 |
def get_latest_reviews(db: sqlite3.Connection):
|
51 |
-
reviews = db.execute("SELECT * FROM reviews ORDER BY id DESC limit
|
52 |
total_reviews = db.execute("Select COUNT(id) from reviews").fetchone()[0]
|
53 |
reviews = pd.DataFrame(reviews, columns=["id", "date_created", "name", "review", "comments"])
|
54 |
return reviews, total_reviews
|
|
|
29 |
repo.git_pull()
|
30 |
|
31 |
# Set db to latest
|
32 |
+
#shutil.copyfile("./data/reviews.db", DB_FILE)
|
33 |
|
34 |
# Create table if it doesn't already exist
|
35 |
|
|
|
48 |
db.close()
|
49 |
|
50 |
def get_latest_reviews(db: sqlite3.Connection):
|
51 |
+
reviews = db.execute("SELECT * FROM reviews ORDER BY id DESC limit 100").fetchall()
|
52 |
total_reviews = db.execute("Select COUNT(id) from reviews").fetchone()[0]
|
53 |
reviews = pd.DataFrame(reviews, columns=["id", "date_created", "name", "review", "comments"])
|
54 |
return reviews, total_reviews
|