You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The calc_predicted_points_for_player returned predicted_points is of type either None, float or jaxlib ArrayImpl.
The jaxlib ArrayImpl is incompatible with postgresql SQLAlchemy, and results in an error when trying to commit the predictions.
One option to fix this is:
forpinpredictions:
# check if db uri contains postgresqlif"postgresql"indbsession.bind.url.drivername:
# check if the predicted_points is a float or jaxlib ArrayImplifhasattr(p.predicted_points, "shape"):
p.predicted_points=p.predicted_points.tolist()
dbsession.add(p)
The text was updated successfully, but these errors were encountered:
Tdarnell
added a commit
to Tdarnell/AIrsenal
that referenced
this issue
Aug 14, 2023
If this is the case it's a bug that should be fixed elsewhere in calc_predicted_points_for_player, as PlayerPrediction.predicted_points should always be a non-null float value per the database schema (airsenal.framework.schema.PlayerPrediction), i.e. calc_predicted_points_for_player should always return a list of valid PlayerPrediction instances compatible with the DB schema.
From a very quick look I struggled to identify when/where the points could end up being a jax array, though. It might be another unintended consequence of us updating package versions recently.
The calc_predicted_points_for_player returned predicted_points is of type either None, float or jaxlib ArrayImpl.
The jaxlib ArrayImpl is incompatible with postgresql SQLAlchemy, and results in an error when trying to commit the predictions.
One option to fix this is:
The text was updated successfully, but these errors were encountered: