diff --git a/recommender/scripts/predict_media_votes.py b/recommender/scripts/predict_media_votes.py index 7b96433..abc971c 100644 --- a/recommender/scripts/predict_media_votes.py +++ b/recommender/scripts/predict_media_votes.py @@ -1,3 +1,5 @@ +from sqlalchemy import text + from database import get_db_connection, get_all_user_ids from predict import predict_votes @@ -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 (' @@ -22,4 +24,4 @@ 'user_id': user_id, 'predicted_vote': row['vote_type'], } - ) + ))