Skip to content

Commit

Permalink
Merge branch 'main' into fix_resolve@main
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Nov 20, 2023
2 parents 80f0983 + 17ecd1d commit 699c4c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: teal
Title: Exploratory Web Apps for Analyzing Clinical Trials Data
Version: 0.14.0.9019
Version: 0.14.0.9020
Date: 2023-11-20
Authors@R: c(
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
Expand Down
6 changes: 2 additions & 4 deletions R/validations.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ validate_has_data <- function(x,
complete = FALSE,
allow_inf = TRUE,
msg = NULL) {
stopifnot(
"Please provide a character vector in msg argument of validate_has_data." = is.character(msg) || is.null(msg)
)
validate(need(!is.null(x) && is.data.frame(x), "No data left."))
checkmate::assert_string(msg, null.ok = TRUE)
checkmate::assert_data_frame(x)
if (!is.null(min_nrow)) {
if (complete) {
complete_index <- stats::complete.cases(x)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-validate_has_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ testthat::test_that("validate_has_data returns message msg argument is set and c
testthat::test_that("validate_has_data returns throws error with non-character msg input", {
testthat::expect_error(
validate_has_data(data, 10, msg = 1),
"Please provide a character vector in msg argument of validate_has_data."
"Assertion on 'msg' failed: Must be of type 'string' \\(or 'NULL'\\), not 'double'"
)

testthat::expect_error(
validate_has_data(data, 10, msg = TRUE),
"Please provide a character vector in msg argument of validate_has_data."
"Assertion on 'msg' failed: Must be of type 'string' \\(or 'NULL'\\), not 'logical'."
)
})

0 comments on commit 699c4c2

Please sign in to comment.