Skip to content

Commit

Permalink
Return early if check for valid values fails
Browse files Browse the repository at this point in the history
  • Loading branch information
annakrystalli committed Sep 28, 2023
1 parent f2921cf commit 97b0955
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion R/check_tbl_values.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Check model output data tbl contains valid value combinations
#'
#' @inherit check_tbl_colnames params
#' @inherit check_tbl_col_types return
#' @inherit check_tbl_colnames return
#' @export
check_tbl_values <- function(tbl, round_id, file_path, hub_path) {
config_tasks <- hubUtils::read_config(hub_path, "tasks")
Expand Down Expand Up @@ -43,6 +43,7 @@ check_tbl_values <- function(tbl, round_id, file_path, hub_path) {
msg_subject = "Data rows",
msg_attribute = "valid value combinations",
msg_verbs = c("contain", "do not contain"),
error = TRUE,
details = details
)
}
2 changes: 1 addition & 1 deletion man/check_tbl_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/testthat/_snaps/check_tbl_values.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
check_tbl_values(tbl = tbl, round_id = round_id, file_path = file_path,
hub_path = hub_path)
Output
<warning/check_failure>
Warning:
Data rows do not contain valid value combinations Affected rows: 1
<error/check_error>
Error:
! Data rows do not contain valid value combinations Affected rows: 1

0 comments on commit 97b0955

Please sign in to comment.