From a344aba11e4731d129595506211dbe02e17e591f Mon Sep 17 00:00:00 2001 From: Vuong Date: Tue, 2 Jul 2024 13:02:28 +0100 Subject: [PATCH] use sdk ClientForHost method --- common/client.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/common/client.go b/common/client.go index e7fa4dc2e4..9c138a22af 100644 --- a/common/client.go +++ b/common/client.go @@ -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 {