Skip to content

Commit

Permalink
remove set_datanames
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Dec 19, 2024
1 parent 706fdad commit fa1271f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 60 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export(modules)
export(new_tdata)
export(report_card_template)
export(reporter_previewer_module)
export(set_datanames)
export(show_rcode_modal)
export(srv_teal)
export(srv_teal_with_splash)
Expand Down
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Introduced `teal_transform_module` to provide a way to interactively modify data delivered to `teal_module`'s `server` and to decorate module outputs. #1228 #1384
* Introduced a new argument `once = FALSE` in `teal_data_module` to possibly reload data during a run time.
* Possibility to download lockfile to restore app session for reproducibility. #479
* Introduced a function `set_datanames()` to change a `datanames` of the `teal_module`.
* Datasets which name starts with `.` are ignored when `module`'s `datanames` is set as `"all"`.
* Added warning when reserved `datanames`, such as `all` and `.raw_data` are being used.

Expand Down
37 changes: 0 additions & 37 deletions R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ setOldClass("teal_modules")
#' - Temporary datasets used to create final versions
#' - Connection objects
#'
#' To exclude irrelevant datasets, use the [set_datanames()] function to change `datanames` from
#' `"all"` to specific names. Trying to modify non-`"all"` values with [set_datanames()] will result
#' in a warning. Datasets with names starting with . are ignored globally unless explicitly listed
#' in `datanames`.
#'
#' # `datanames` with `transformators`
#' When transformators are specified, their `datanames` are added to the module’s `datanames`, which
Expand Down Expand Up @@ -591,39 +587,6 @@ print.teal_modules <- function(x, ...) {
invisible(x)
}

#' @param modules (`teal_module` or `teal_modules`)
#' @rdname teal_modules
#' @examples
#' # change the module's datanames
#' set_datanames(module(datanames = "all"), "a")
#'
#' # change modules' datanames
#' set_datanames(
#' modules(
#' module(datanames = "all"),
#' module(datanames = "a")
#' ),
#' "b"
#' )
#' @export
set_datanames <- function(modules, datanames) {
checkmate::assert_multi_class(modules, c("teal_modules", "teal_module"))
if (inherits(modules, "teal_modules")) {
modules$children <- lapply(modules$children, set_datanames, datanames)
} else {
if (identical(modules$datanames, "all")) {
modules$datanames <- datanames
} else {
warning(
"Not possible to modify datanames of the module ", modules$label,
". set_datanames() can only change datanames if it was set to \"all\".",
call. = FALSE
)
}
}
modules
}

# utilities ----
## subset or modify modules ----

Expand Down
21 changes: 0 additions & 21 deletions man/teal_modules.Rd

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

0 comments on commit fa1271f

Please sign in to comment.