Skip to content

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

Closed

Description

@mrcaseb

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```

Activity

  1. mrcaseb commented on Oct 23, 2021

    @mrcaseb
    MemberAuthor
    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions