Update SDK (#79)

This commit is contained in:
Pieter Noordhuis 2022-09-27 09:58:55 -07:00 committed by GitHub
parent f27cb7149d
commit a1b6fdb2e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -44,7 +44,7 @@ func getRemoteSyncCallback(ctx context.Context, root, remoteDir string, wsc *wor
return func(d diff) error { return func(d diff) error {
for _, filePath := range d.delete { for _, filePath := range d.delete {
err := wsc.Workspace.Delete(ctx, err := wsc.Workspace.Delete(ctx,
workspace.DeleteRequest{ workspace.Delete{
Path: path.Join(remoteDir, filePath), Path: path.Join(remoteDir, filePath),
Recursive: true, Recursive: true,
}, },

@ -1 +1 @@
Subproject commit 521bddb126b490fcf7fac4dcff7774d749871b0f Subproject commit 71789bb56a381e3c14f8136c69d00a98d8536a70

View File

@ -33,7 +33,7 @@ func TestAccSync(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
t.Cleanup(func() { t.Cleanup(func() {
err := wsc.Repos.DeleteByRepoId(ctx, fmt.Sprint(repoInfo.Id)) err := wsc.Repos.DeleteByRepoId(ctx, repoInfo.Id)
assert.NoError(t, err) assert.NoError(t, err)
}) })

View File

@ -217,17 +217,17 @@ func (p *project) GetDevelopmentClusterId(ctx context.Context) (clusterId string
} }
} }
func runCommandOnDev(ctx context.Context, language, command string) commands.CommandResults { func runCommandOnDev(ctx context.Context, language, command string) commands.Results {
clusterId, err := Get(ctx).GetDevelopmentClusterId(ctx) clusterId, err := Get(ctx).GetDevelopmentClusterId(ctx)
if err != nil { if err != nil {
return commands.CommandResults{ return commands.Results{
ResultType: "error", ResultType: "error",
Summary: err.Error(), Summary: err.Error(),
} }
} }
return Get(ctx).wsc.Commands.Execute(ctx, clusterId, language, command) return Get(ctx).wsc.CommandExecutor.Execute(ctx, clusterId, language, command)
} }
func RunPythonOnDev(ctx context.Context, command string) commands.CommandResults { func RunPythonOnDev(ctx context.Context, command string) commands.Results {
return runCommandOnDev(ctx, "python", command) return runCommandOnDev(ctx, "python", command)
} }

View File

@ -22,7 +22,7 @@ func CreateDbfsFile(ctx context.Context,
// see https://docs.databricks.com/dev-tools/api/latest/dbfs.html#add-block // see https://docs.databricks.com/dev-tools/api/latest/dbfs.html#add-block
const WRITE_BYTE_CHUNK_SIZE = 1e6 const WRITE_BYTE_CHUNK_SIZE = 1e6
createResponse, err := wsc.Dbfs.Create(ctx, createResponse, err := wsc.Dbfs.Create(ctx,
dbfs.CreateRequest{ dbfs.Create{
Overwrite: overwrite, Overwrite: overwrite,
Path: path, Path: path,
}, },
@ -39,7 +39,7 @@ func CreateDbfsFile(ctx context.Context,
} }
b64Data := base64.StdEncoding.EncodeToString(byteChunk) b64Data := base64.StdEncoding.EncodeToString(byteChunk)
err := wsc.Dbfs.AddBlock(ctx, err := wsc.Dbfs.AddBlock(ctx,
dbfs.AddBlockRequest{ dbfs.AddBlock{
Data: b64Data, Data: b64Data,
Handle: handle, Handle: handle,
}, },
@ -49,7 +49,7 @@ func CreateDbfsFile(ctx context.Context,
} }
} }
err = wsc.Dbfs.Close(ctx, err = wsc.Dbfs.Close(ctx,
dbfs.CloseRequest{ dbfs.Close{
Handle: handle, Handle: handle,
}, },
) )