Skip to content

Commit

Permalink
Handle "no configuration file found at" error during databricks-cli a…
Browse files Browse the repository at this point in the history
…uthentication (#707)

## Changes
The CLI produced a new error message during `databricks auth token`
between v0.207.1 and v0.209.1 when no .databrickscfg file exists. This
manifests primarily in unit tests which call the `databricks` CLI, but
could also affect users using the SDK and CLI between these versions.

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [ ] `make test` passing
- [ ] `make fmt` applied
- [ ] relevant integration tests applied
  • Loading branch information
mgyucht authored Nov 23, 2023
1 parent d41b41a commit 9ebd7ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/auth_databricks_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ func (c DatabricksCliCredentials) Configure(ctx context.Context, cfg *Config) (f

_, err = ts.Token()
if err != nil {
if strings.Contains(err.Error(), "no configuration file found at") {
// databricks auth token produced this error message between
// v0.207.1 and v0.209.1
return nil, nil
}
if strings.Contains(err.Error(), "databricks OAuth is not") {
// OAuth is not configured or not supported
return nil, nil
Expand Down

0 comments on commit 9ebd7ca

Please sign in to comment.