Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dssecret committed Nov 15, 2023
1 parent 46fea78 commit 3cf5b77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions estimate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pandas as pd
from tornium_celery.tasks.user import update_user
from tornium_commons import rds
from tornium_commons.models import PersonalStat, User
from tornium_commons.models import PersonalStats, User
import xgboost


Expand Down Expand Up @@ -42,8 +42,8 @@ def estimate_user(user_tid: int, api_key: str) -> typing.Tuple[int, int]:
except (ValueError, TypeError):
pass

ps: typing.Optional[PersonalStat] = (
PersonalStat.select().where(PersonalStat.tid == user_tid).order_by(-PersonalStat.timestamp).first()
ps: typing.Optional[PersonalStats] = (
PersonalStats.select().where(PersonalStats.tid == user_tid).order_by(-PersonalStats.timestamp).first()
)
df: pd.DataFrame

Expand All @@ -64,7 +64,7 @@ def estimate_user(user_tid: int, api_key: str) -> typing.Tuple[int, int]:
except Exception:
update_error = True

ps = PersonalStat.select().where(PersonalStat.tid == user_tid).order_by(-PersonalStat.timestamp).first()
ps = PersonalStats.select().where(PersonalStats.tid == user_tid).order_by(-PersonalStats.timestamp).first()

if ps is None:
raise ValueError("Personal stats could not be found in the database")
Expand Down

0 comments on commit 3cf5b77

Please sign in to comment.