Skip to content

Commit

Permalink
[Hotfix] Handle missing data (#440)
Browse files Browse the repository at this point in the history
This PR changes how missing data for reward targets is identified. It
fixes a bug where missing data causes the script to crash.

The issue seems to come from a column without valid values being
misidentified as float column and the missing value is encoded as `NaN`.
This was not identified as missing data since it only checks for `None`.

With this PR, the pandas function `isna` is used to identify missing
data.

A similar approach was used in #435.

Since local tests are still running, I created this as draft PR. I will
remove the draft status once the local run is successful.

---------

Co-authored-by: Haris Angelidakis <[email protected]>
  • Loading branch information
fhenneke and harisang authored Dec 3, 2024
1 parent 3f60969 commit 613dda2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ def from_series(cls, frame: Series) -> RewardAndPenaltyDatum:
)
solver = frame["solver"]
reward_target = frame["reward_target"]
if reward_target is None:
if pandas.isna(reward_target):
log.warning(f"Solver {solver} without reward_target. Using solver")
reward_target = solver

buffer_accounting_target = frame["buffer_accounting_target"]
if buffer_accounting_target is None:
if pandas.isna(buffer_accounting_target):
log.warning(
f"Solver {solver} without buffer_accounting_target. Using solver"
)
Expand Down

0 comments on commit 613dda2

Please sign in to comment.