From 47de59afa0c48c83ad22343440788bbd1b72ba7b Mon Sep 17 00:00:00 2001 From: Edgar Ruiz Date: Mon, 30 Sep 2024 10:40:41 -0500 Subject: [PATCH] Properly handles lack of host or token --- R/board-databricks.R | 10 ++++++++-- tests/testthat/_snaps/board-databricks.md | 14 -------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/R/board-databricks.R b/R/board-databricks.R index 542a121f..752f953b 100644 --- a/R/board-databricks.R +++ b/R/board-databricks.R @@ -75,8 +75,14 @@ board_databricks <- function( } board_databricks_test <- function(prefix = NULL) { - testthat::skip_if(is.null(db_get_token()), message = "No Databricks credentials found") - testthat::skip_if(is.null(db_get_host()), message = "No Databricks host defined") + testthat::skip_if( + db_get_token(fail = FALSE) == "", + message = "No Databricks credentials found" + ) + testthat::skip_if( + db_get_host(fail = FALSE) == "", + message = "No Databricks host defined" + ) skip_if_missing_envvars( tests = "board_databricks()", envvars = c("PINS_DATABRICKS_FOLDER_URL") diff --git a/tests/testthat/_snaps/board-databricks.md b/tests/testthat/_snaps/board-databricks.md index cb8fb245..9211a0a7 100644 --- a/tests/testthat/_snaps/board-databricks.md +++ b/tests/testthat/_snaps/board-databricks.md @@ -6,17 +6,3 @@ Pin board Cache size: 0 -# can find board required pkgs - - Code - required_pkgs(board) - Output - [1] "httr2" - ---- - - Code - required_pkgs(board) - Output - [1] "httr2" -