Calling get_footywire_betting_odds for the 2020 season raises an error, because the use of pivot_wider assumes that two matches are never played at the same venue on the same day. However, the upcoming round has two matches at Metricon stadium, which means pivoting groups multiple teams together into the team columns, which breaks downstream type checks (the specific error is "must be a character vector, not a list" when we call case_when inside replace_teams.
I have a fix in #122
Adding a temporary Match.ID column guarantees unique match values for pivoting to one match per row. Since we just need the column for this purpose, I dropped it after pivoting, but not sure if there's any value in keeping it.
I also updated the tests to include the 2020 season for betting data to make sure we catch any regressions.
Calling
get_footywire_betting_odds
for the 2020 season raises an error, because the use ofpivot_wider
assumes that two matches are never played at the same venue on the same day. However, the upcoming round has two matches at Metricon stadium, which means pivoting groups multiple teams together into the team columns, which breaks downstream type checks (the specific error is "must be a character vector, not a list" when we callcase_when
insidereplace_teams
.I have a fix in #122
Adding a temporary
Match.ID
column guarantees unique match values for pivoting to one match per row. Since we just need the column for this purpose, I dropped it after pivoting, but not sure if there's any value in keeping it.I also updated the tests to include the 2020 season for betting data to make sure we catch any regressions.