Skip to content

Commit

Permalink
fix predicted vote db insert
Browse files Browse the repository at this point in the history
  • Loading branch information
nitwhiz committed Sep 6, 2023
1 parent 24b9696 commit 6641f8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions recommender/scripts/predict_media_votes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from sqlalchemy import text

from database import get_db_connection, get_all_user_ids
from predict import predict_votes

Expand All @@ -9,7 +11,7 @@
p_media = predict_votes(conn, user_id)

for idx, row in p_media.iterrows():
conn.execute(
conn.execute(text(
'insert into media_user_vote_prediction ('
'media_id, user_id, predicted_vote, created_at, updated_at'
') values ('
Expand All @@ -22,4 +24,4 @@
'user_id': user_id,
'predicted_vote': row['vote_type'],
}
)
))

0 comments on commit 6641f8c

Please sign in to comment.