Skip to content

Commit

Permalink
Merge branch 'first_prefer' into 'develop'
Browse files Browse the repository at this point in the history
First prefer

See merge request s08-bigdata-recom-sub2/S08P22C103!355
  • Loading branch information
meanwo committed Apr 5, 2023
2 parents 05c7a69 + bb467d6 commit f3c43ad
Show file tree
Hide file tree
Showing 5 changed files with 1,441 additions and 7 deletions.
5 changes: 2 additions & 3 deletions AI/app/snack_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ def weighted_random_indexes(numbers):
review_cursor = cursor.fetchall()
review_df = pd.DataFrame(review_cursor)

total_user = "SELECT COUNT(*) FROM sock.member;"
total_user = "SELECT member_id FROM member ORDER BY member_id DESC LIMIT 1;"
cursor.execute(total_user)
user_cursor = cursor.fetchall()[0]['COUNT(*)']
print('check', user_cursor)
user_cursor = cursor.fetchall()[0]['member_id']

total_snack = "SELECT COUNT(*) FROM sock.snack;"
cursor.execute(total_snack)
Expand Down
Binary file modified AI/fastapi_mysql/__pycache__/snack_db.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion AI/fastapi_mysql/first_prefer.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions AI/fastapi_mysql/snack_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,9 @@ def filter_df(df, column_name, value):
review_cursor = cursor.fetchall()
review_df = pd.DataFrame(review_cursor)

total_user = "SELECT COUNT(*) FROM sock.member;"
total_user = "SELECT member_id FROM member ORDER BY member_id DESC LIMIT 1;"
cursor.execute(total_user)
user_cursor = cursor.fetchall()[0]['COUNT(*)']
print('check', user_cursor)
user_cursor = cursor.fetchall()[0]['member_id']

total_snack = "SELECT COUNT(*) FROM sock.snack;"
cursor.execute(total_snack)
Expand Down
Loading

0 comments on commit f3c43ad

Please sign in to comment.