Skip to content

Commit

Permalink
use sdk ClientForHost method
Browse files Browse the repository at this point in the history
  • Loading branch information
nkvuong committed Jul 3, 2024
1 parent 75236a6 commit a344aba
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,9 @@ func (c *DatabricksClient) ClientForHost(ctx context.Context, url string) (*Data
if err != nil {
return nil, fmt.Errorf("cannot authenticate parent client: %w", err)
}
cfg := &config.Config{
Host: url,
Username: c.Config.Username,
Password: c.Config.Password,
AuthType: c.Config.AuthType,
Token: c.Config.Token,
ClientID: c.Config.ClientID,
ClientSecret: c.Config.ClientSecret,
GoogleServiceAccount: c.Config.GoogleServiceAccount,
GoogleCredentials: c.Config.GoogleCredentials,
InsecureSkipVerify: c.Config.InsecureSkipVerify,
HTTPTimeoutSeconds: c.Config.HTTPTimeoutSeconds,
DebugTruncateBytes: c.Config.DebugTruncateBytes,
DebugHeaders: c.Config.DebugHeaders,
RateLimitPerSecond: c.Config.RateLimitPerSecond,
cfg, err := c.DatabricksClient.Config.NewWithWorkspaceHost(url)
if err != nil {
return nil, fmt.Errorf("cannot configure new client: %w", err)
}
client, err := client.New(cfg)
if err != nil {
Expand Down

0 comments on commit a344aba

Please sign in to comment.