Skip to content

Commit

Permalink
use NA when there is no deadline
Browse files Browse the repository at this point in the history
  • Loading branch information
fmichonneau committed Jul 2, 2024
1 parent 9af3070 commit aef3803
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions R/deadline.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ extract_deadline <- function(parsed, ...) {
needs_fix <- xml2::xml_find_all(x, ".//tr//td//span[@style]")
needs_fix <- xml2::xml_text(needs_fix)
if (identical(length(needs_fix), 0L)) {
return(character(1))
return(NA_character_)
}
if (!grepl("issues need fixing before", needs_fix)) {
warning("Unrecognized value: ", needs_fix, call. = FALSE)
return(character(1))
return(NA_character_)
}
date_match <- regexpr("\\d{4}-\\d{2}-\\d{2}", needs_fix)
regmatches(needs_fix, date_match)
Expand Down Expand Up @@ -74,11 +74,6 @@ deadline_pkg_crandb <- function(pkg, ...) {
pkgs <- as.data.frame(get_cran_rds_file("packages", ...), stringsAsFactors = FALSE)
res <- pkgs[pkgs$Package %in% pkg, c("Package", "Deadline")]

## we overwrite CRAN's content to match foghorn's logic
## NA means that we didn't check if there is a deadline when using the website data;
## "" means that we checked and there is no deadline set.
res$Deadline[is.na(res$Deadline)] <- ""

tibble::tibble(
package = res$Package,
deadline = res$Deadline
Expand Down

0 comments on commit aef3803

Please sign in to comment.