Skip to content

Commit

Permalink
Minor review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Pandey <[email protected]>
  • Loading branch information
Sweetdevil144 committed Oct 9, 2024
1 parent a578be2 commit 293a68b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions base/db/R/check.missing.files.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @author Betsy Cowdery, Michael Dietze, Ankur Desai, Tony Gardella, Luke Dramko

check_missing_files <- function(result, outname, existing.input = NULL, existing.dbfile = NULL) {
check_missing_files <- function(result, existing.input = NULL, existing.dbfile = NULL) {
result_sizes <- purrr::map_dfr(
result,
~ dplyr::mutate(
Expand All @@ -35,12 +35,12 @@ check_missing_files <- function(result, outname, existing.input = NULL, existing
}


# Wrap in a list for consistant processing later
if (exists("existing.input") && is.data.frame(existing.input)) {
# Wrap in a list for consistent processing later
if (is.data.frame(existing.input)) {
existing.input <- list(existing.input)
}

if (exists("existing.dbfile") && is.data.frame(existing.dbfile)) {
if (is.data.frame(existing.dbfile)) {
existing.dbfile <- list(existing.dbfile)
}
return(list(existing.input, existing.dbfile))
Expand Down
2 changes: 1 addition & 1 deletion base/db/R/convert_input.R
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ convert_input <-
#--------------------------------------------------------------------------------------------------#
# Check if result has empty or missing files

checked.missing.files <- check_missing_files(result, outname, existing.input, existing.dbfile)
checked.missing.files <- check_missing_files(result, existing.input, existing.dbfile)

# Unwrap parameters after performing checks for missing files
existing.input <- checked.missing.files$existing.input
Expand Down
1 change: 0 additions & 1 deletion base/db/tests/testthat/test.check.missing.files.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ test_that("`check_missing_files()` able to return correct missing files", {

res <- check_missing_files(
result = list(data.frame(file = c("A", "B"))),
outname = "test",
existing.input = data.frame(),
existing.dbfile = data.frame()
)
Expand Down

0 comments on commit 293a68b

Please sign in to comment.