Skip to content

Commit

Permalink
Merge pull request #2044 from cynkra/f-more-top-level
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored Oct 16, 2023
2 parents 51e35ba + d2f5ee8 commit 392dcb4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion R/db-interface.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ copy_dm_to <- function(

check_not_zoomed(dm)

check_suggested("dbplyr", use = TRUE)
check_suggested("dbplyr", use = TRUE, "copy_dm_to")

dest <- src_from_src_or_con(dest)
src_names <- src_tbls_impl(dm)
Expand Down
6 changes: 3 additions & 3 deletions R/descriptions.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
dm_set_table_description <- function(dm, ...) {
check_not_zoomed(dm)

check_suggested("labelled", use = TRUE, version = "2.12.0")
check_suggested("labelled", use = TRUE, "dm_set_table_description", version = "2.12.0")

def <- dm_get_def(dm, quiet = TRUE)
selected <- eval_select_indices(quo(c(...)), src_tbls_impl(dm))
Expand Down Expand Up @@ -77,7 +77,7 @@ dm_get_table_description <- function(dm, table = NULL, ...) {
check_dots_empty()
check_not_zoomed(dm)

check_suggested("labelled", use = TRUE, version = "2.12.0")
check_suggested("labelled", use = TRUE, "dm_get_table_description", version = "2.12.0")

table_expr <- enexpr(table) %||% src_tbls_impl(dm, quiet = TRUE)
tables <- eval_select_indices(table_expr, set_names(src_tbls_impl(dm, quiet = TRUE)))
Expand Down Expand Up @@ -115,7 +115,7 @@ dm_reset_table_description <- function(dm, table = NULL, ...) {
check_dots_empty()
check_not_zoomed(dm)

check_suggested("labelled", use = TRUE, version = "2.12.0")
check_suggested("labelled", use = TRUE, "dm_reset_table_description", version = "2.12.0")

table_expr <- enexpr(table) %||% src_tbls_impl(dm, quiet = TRUE)
def <- dm_get_def(dm, quiet = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion R/dm_from_con.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dm_from_con <- function(
...) {
stopifnot(is(con, "DBIConnection") || inherits(con, "Pool"))

check_suggested("dbplyr", use = TRUE)
check_suggested("dbplyr", use = TRUE, "dm_from_con")

if (inherits(con, "Pool")) {
con <- pool_con <- pool::poolCheckout(con)
Expand Down
22 changes: 14 additions & 8 deletions R/dm_gui.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@
dm_gui <- function(..., dm = NULL, select_tables = TRUE, debug = FALSE) {
check_dots_empty()

check_suggested("colourpicker", use = TRUE)
check_suggested("htmltools", use = TRUE)
check_suggested("htmlwidgets", use = TRUE)
check_suggested("reactable", use = TRUE)
check_suggested("rstudioapi", use = TRUE)
check_suggested("shiny", use = TRUE)
check_suggested("shinyAce", use = TRUE)
check_suggested("shinydashboard", use = TRUE)
check_suggested(
c(
"colourpicker",
"htmltools",
"htmlwidgets",
"reactable",
"rstudioapi",
"shiny",
"shinyAce",
"shinydashboard"
),
use = TRUE,
top_level_fun = "dm_gui"
)

dm <- dm_ptype(dm)

Expand Down
8 changes: 4 additions & 4 deletions R/dm_sql.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dm_sql <- function(
table_names = NULL,
temporary = TRUE) {
#
check_suggested("dbplyr", use = TRUE)
check_suggested("dbplyr", use = TRUE, top_level_fun = "dm_sql")

table_names <- ddl_check_table_names(table_names, dm)

Expand Down Expand Up @@ -101,7 +101,7 @@ dm_ddl_pre <- function(
table_names = NULL,
temporary = TRUE) {
#
check_suggested("dbplyr", use = TRUE)
check_suggested("dbplyr", use = TRUE, "dm_ddl_pre")

table_names <- ddl_check_table_names(table_names, dm)

Expand Down Expand Up @@ -191,7 +191,7 @@ dm_dml_load <- function(
table_names = NULL,
temporary = TRUE) {
#
check_suggested("dbplyr", use = TRUE)
check_suggested("dbplyr", use = TRUE, "dm_dml_load")

table_names <- ddl_check_table_names(table_names, dm)

Expand All @@ -218,7 +218,7 @@ dm_ddl_post <- function(
table_names = NULL,
temporary = TRUE) {
#
check_suggested("dbplyr", use = TRUE)
check_suggested("dbplyr", use = TRUE, "dm_ddl_post")

table_names <- ddl_check_table_names(table_names, dm)

Expand Down
2 changes: 1 addition & 1 deletion R/nycflights13.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dm_nycflights13 <- function(..., cycle = FALSE, color = TRUE, subset = TRUE, com
airports <- data$airports
planes <- data$planes
} else {
check_suggested("nycflights13", use = TRUE)
check_suggested("nycflights13", use = TRUE, top_level_fun = "dm_nycflights13")

flights <- nycflights13::flights
weather <- nycflights13::weather
Expand Down

0 comments on commit 392dcb4

Please sign in to comment.