Skip to content

Commit

Permalink
@kartikayakirar
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Nov 10, 2023
1 parent 971c7d5 commit 72abf29
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
21 changes: 20 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ resolve_modules_datanames <- function(modules, datanames, join_keys) {
}
}

#' Check `datanames` in modules
#'
#' This function ensures specified `datanames` in modules match those in the data object,
#' returning error messages or `TRUE` for successful validation.
#'
#' @param modules (`teal_modules`) object
#' @param datanames (`character`) names of datasets available in the `data` object
#'
#' @return A `character(1)` containing error message or `TRUE` if validation passes.
#' @keywords internal
check_modules_datanames <- function(modules, datanames) {
recursive_check_datanames <- function(modules, datanames) {
# check teal_modules against datanames
Expand All @@ -166,7 +176,16 @@ check_modules_datanames <- function(modules, datanames) {
}
}


#' Check `datanames` in filters
#'
#' This function check `datanames` in filters correspond to those in `data`,
#' returning character vector with error messages or TRUE if all checks pass.
#'
#' @param filters (`teal_slices`) object
#' @param datanames (`character`) names of datasets available in the `data` object
#'
#' @return A `character(1)` containing error message or TRUE if validation passes.
#' @keywords internal
check_filter_datanames <- function(filters, datanames) {
# check teal_slices against datanames
out <- sapply(
Expand Down
21 changes: 21 additions & 0 deletions man/check_filter_datanames.Rd

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

21 changes: 21 additions & 0 deletions man/check_modules_datanames.Rd

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

0 comments on commit 72abf29

Please sign in to comment.