mirror of https://github.com/databricks/cli.git
Update SDK (#79)
This commit is contained in:
parent
f27cb7149d
commit
a1b6fdb2e8
|
@ -44,7 +44,7 @@ func getRemoteSyncCallback(ctx context.Context, root, remoteDir string, wsc *wor
|
|||
return func(d diff) error {
|
||||
for _, filePath := range d.delete {
|
||||
err := wsc.Workspace.Delete(ctx,
|
||||
workspace.DeleteRequest{
|
||||
workspace.Delete{
|
||||
Path: path.Join(remoteDir, filePath),
|
||||
Recursive: true,
|
||||
},
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 521bddb126b490fcf7fac4dcff7774d749871b0f
|
||||
Subproject commit 71789bb56a381e3c14f8136c69d00a98d8536a70
|
|
@ -33,7 +33,7 @@ func TestAccSync(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
t.Cleanup(func() {
|
||||
err := wsc.Repos.DeleteByRepoId(ctx, fmt.Sprint(repoInfo.Id))
|
||||
err := wsc.Repos.DeleteByRepoId(ctx, repoInfo.Id)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
|
|
|
@ -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)
|
||||
if err != nil {
|
||||
return commands.CommandResults{
|
||||
return commands.Results{
|
||||
ResultType: "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)
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ func CreateDbfsFile(ctx context.Context,
|
|||
// see https://docs.databricks.com/dev-tools/api/latest/dbfs.html#add-block
|
||||
const WRITE_BYTE_CHUNK_SIZE = 1e6
|
||||
createResponse, err := wsc.Dbfs.Create(ctx,
|
||||
dbfs.CreateRequest{
|
||||
dbfs.Create{
|
||||
Overwrite: overwrite,
|
||||
Path: path,
|
||||
},
|
||||
|
@ -39,7 +39,7 @@ func CreateDbfsFile(ctx context.Context,
|
|||
}
|
||||
b64Data := base64.StdEncoding.EncodeToString(byteChunk)
|
||||
err := wsc.Dbfs.AddBlock(ctx,
|
||||
dbfs.AddBlockRequest{
|
||||
dbfs.AddBlock{
|
||||
Data: b64Data,
|
||||
Handle: handle,
|
||||
},
|
||||
|
@ -49,7 +49,7 @@ func CreateDbfsFile(ctx context.Context,
|
|||
}
|
||||
}
|
||||
err = wsc.Dbfs.Close(ctx,
|
||||
dbfs.CloseRequest{
|
||||
dbfs.Close{
|
||||
Handle: handle,
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue