Skip to content

Conversation

@nfx
Copy link
Collaborator

@nfx nfx commented Mar 27, 2024

No description provided.

if (!is_azure()) {
return(NULL)
}
token_source <- .azure_cli_token_source("2ff814a6-3304-4ab8-85cb-cd0e6f879c1d")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. It holds private state used for token refreshing internally when it's about to expire

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix is_<cloud> functions to handle NULL:

is_azure <- function() {
grepl(".azuredatabricks.net", cfg$host)
}
# is_gcp returns true if client is configured for GCP
is_gcp <- function() {
grepl(".gcp.databricks.com", cfg$host)
}
# is_aws returns true if client is configured for AWS
is_aws <- function() {
!is_azure() & !is_gcp()
}

e.g.

is_azure <- function() {
  if (!is.null(cfg$host)) {
    grepl(".azuredatabricks.net", cfg$host)
  } else {
    FALSE
  }
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a bit irrelevant to this PR, can you please send one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, in this case, we won't have null there, per se

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants