Skip to content

Commit

Permalink
Do not error if we cannot prompt for a profile in auth login (#1745)
Browse files Browse the repository at this point in the history
## Changes
With #1370 we started to error if
a profile name was not provided in a non-tty setting. The Databricks
VSCode extension, however, uses the `auth login` command to simply
refresh the tokens. Thus, this PR is a regression fix for that use case.

## Tests
Manually, `databricks auth login --host
https://e2-dogfood.staging.cloud.databricks.com` no longer errors.
Instead it successfully refreshes the credentials.
  • Loading branch information
shreyas-goenka authored Sep 4, 2024
1 parent 072fa81 commit 35cdf40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

func promptForProfile(ctx context.Context, defaultValue string) (string, error) {
if !cmdio.IsInTTY(ctx) {
return "", fmt.Errorf("the command is being run in a non-interactive environment, please specify a profile using --profile")
return "", nil
}

prompt := cmdio.Prompt(ctx)
Expand Down

0 comments on commit 35cdf40

Please sign in to comment.