Skip to content

Commit

Permalink
Check duplicate names in sql_translator()
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 6, 2023
1 parent cc8ecdb commit 55cf038
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/translate-sql-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ sql_translator <- function(...,
funs <- c(list2(...), .funs)
if (length(funs) == 0) return(.parent)

if (anyDuplicated(names(funs))) {
cli_abort(c(
"Duplicate names in {.fun sql_translator}",
"*" = unique(names(funs)[duplicated(names(funs))])
))
}

list2env(funs, copy_env(.parent))
}

Expand Down

0 comments on commit 55cf038

Please sign in to comment.