Skip to content

Commit

Permalink
when non-unique names are passed to decorators, throw a warning from …
Browse files Browse the repository at this point in the history
…assert_decorators, and let it pass through normalize_decorators
  • Loading branch information
m7pr committed Feb 6, 2025
1 parent 9caafdf commit af0f09e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,9 @@ select_decorators <- function(decorators, scope) {
#' @keywords internal
normalize_decorators <- function(decorators) {
if (checkmate::test_list(decorators, "teal_transform_module")) {
decorators_names <- setdiff(names(decorators), "")
decorators_names <- names(decorators)[!names(decorators) %in% ""]
# Above is equivalent to decorators_names <- setdiff(names(decorators), "")
# but can return non-unique values. Non-unique values are checked in assert_decorators.
if (length(decorators_names) == 0) {
list(default = decorators)
} else if (length(decorators_names) == length(decorators)) {
Expand Down

0 comments on commit af0f09e

Please sign in to comment.