Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Databricks CLI & Azure CLI authentication and a basic integration test #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

2 participants