Skip to content

Commit

Permalink
Add support for default application value within snowflake() (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
blairj09 authored Oct 9, 2024
1 parent 335e1c8 commit bd66867
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/driver-snowflake.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ snowflake_args <- function(account = Sys.getenv("SNOWFLAKE_ACCOUNT"),
auth <- snowflake_auth_args(account, ...)
all <- utils::modifyList(c(args, auth), list(...))

# Respect the Snowflake Partner environment variable, if present.
if (is.null(all$application) && nchar(Sys.getenv("SF_PARTNER")) != 0) {
all$application <- Sys.getenv("SF_PARTNER")
# Set application value and respect the Snowflake Partner environment variable, if present.
if (is.null(all$application)) {
if (nchar(Sys.getenv("SF_PARTNER")) != 0 ){
all$application <- Sys.getenv("SF_PARTNER")
} else {
all$application <- paste0("r-odbc/", packageVersion("odbc"))
}
}

arg_names <- tolower(names(all))
Expand Down

0 comments on commit bd66867

Please sign in to comment.