Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add_xpass() can’t handle an empty df properly #296

Closed
mrcaseb opened this issue Oct 23, 2021 · 1 comment · Fixed by #297
Closed

add_xpass() can’t handle an empty df properly #296

mrcaseb opened this issue Oct 23, 2021 · 1 comment · Fixed by #297

Comments

@mrcaseb
Copy link
Member

mrcaseb commented Oct 23, 2021

The other function like clean_pbp() or add_qb_epa() run checks for nrow(pbp) == 0. This appears to be missing in xpass which can result in behavior like this

-- Update nflfastR Play-by-Play Database ------------- nflfastR version 4.3.0 --
* 19:48:48 | Checking for missing completed games...
i 19:48:59 | You have 5943 games and are missing 1.
* 19:48:59 | Start download of 1 game...
The following warning has occured:
i 19:48:59 | Nothing to clean. Return passed data frame.
v 19:48:59 | Cleaning completed
i 19:48:59 | Nothing to do. Return passed data frame.
v 19:48:59 | added qb_epa
i 19:48:59 | Nothing to do. Return passed data frame.
Error in format_error_bullets(x[-1]) : 
  nms %in% c("i", "x", "") are not all TRUE```
@mrcaseb
Copy link
Member Author

mrcaseb commented Oct 23, 2021

data.frame() |> nflfastR::add_xyac()
#> ℹ 12:15:50 | Nothing to do. Return passed data frame.
#> data frame with 0 columns and 0 rows
data.frame() |> nflfastR::add_xpass()
#> Error in format_error_bullets(x[-1]): nms %in% c("i", "x", "") are not all TRUE

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant