check_decorators: Check decorators list

View source: R/decorators-helpers.R

check_decoratorsR Documentation

Check decorators list

Description

Check if a decorators list is valid and matches the expected output names.

Usage

check_decorators(x, names = NULL)

assert_decorators(x, names = NULL, .var.name = checkmate::vname(x), add = NULL)

Arguments

x

(named list) of teal_transform_module() objects, or nested lists thereof.

names

(character) optional vector of valid output names. When provided, all names in x must be one of these names, and names must be unique.

.var.name

[character(1)]
The custom name for x as passed to any assert* function. Defaults to a heuristic name lookup.

add

If an AssertCollection is provided, the error message is stored in it. If NULL, an exception is raised if res is not TRUE.

Value

TRUE if valid, otherwise a character(1) string describing the problem.

See Also

module_transform_data()

Examples

decorator <- teal_transform_module(server = function(id, data) data)
check_decorators(decorator)
check_decorators(list(all = decorator))
check_decorators(list(all = decorator, output = decorator))
check_decorators(list(all = decorator, output = list(decorator, decorator)))

teal documentation built on June 30, 2026, 5:11 p.m.