Skip to content

Commit

Permalink
Remove TealData checks (#1406)
Browse files Browse the repository at this point in the history
# Pull Request

Fixes #1386

Removes TealData checks from the code base

---------

Signed-off-by: Lluís Revilla <[email protected]>
Co-authored-by: Marcin <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <[email protected]>
  • Loading branch information
4 people authored Nov 15, 2024
1 parent d9fb47d commit 1767e03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
10 changes: 0 additions & 10 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,6 @@ init <- function(data,

# argument checking (independent)
## `data`
if (inherits(data, "TealData")) {
lifecycle::deprecate_stop(
when = "0.15.0",
what = "init(data)",
paste(
"TealData is no longer supported. Use teal_data() instead.",
"Please follow migration instructions https://github.com/insightsengineering/teal/discussions/988."
)
)
}
checkmate::assert_multi_class(data, c("teal_data", "teal_data_module"))
checkmate::assert_class(landing_popup, "teal_module_landing", null.ok = TRUE)

Expand Down
4 changes: 2 additions & 2 deletions R/modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ module <- function(label = "module",
"\n - `...` server_args elements will be passed to the module named argument or to the `...`"
)
}

if ("datasets" %in% server_formals) {
warning(
sprintf("Called from module(label = \"%s\", ...)\n ", label),
Expand All @@ -205,7 +206,6 @@ module <- function(label = "module",
)
}


## UI
checkmate::assert_function(ui)
ui_formals <- names(formals(ui))
Expand All @@ -217,6 +217,7 @@ module <- function(label = "module",
"\n - `...` ui_args elements will be passed to the module argument of the same name or to the `...`"
)
}

if (any(c("data", "datasets") %in% ui_formals)) {
stop(
sprintf("Called from module(label = \"%s\", ...)\n ", label),
Expand All @@ -226,7 +227,6 @@ module <- function(label = "module",
)
}


## `filters`
if (!missing(filters)) {
datanames <- filters
Expand Down
4 changes: 3 additions & 1 deletion man/teal_data_module.Rd

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

1 change: 0 additions & 1 deletion tests/testthat/test-modules.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ testthat::test_that("module warns when server contains datasets argument", {
)
})


testthat::test_that("module expects server being a shiny server module with any argument", {
testthat::expect_no_error(module(server = function(id) NULL))

Expand Down

0 comments on commit 1767e03

Please sign in to comment.