Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 1329476

Browse files
authored
Return nil if ResourceMeta is nil when deleting the node (#310)
* wip Signed-off-by: Kevin Su <pingsutw@apache.org> * wip Signed-off-by: Kevin Su <pingsutw@apache.org> * wip Signed-off-by: Kevin Su <pingsutw@apache.org> * transition to failed state if task isn't created Signed-off-by: Kevin Su <pingsutw@apache.org> * wip Signed-off-by: Kevin Su <pingsutw@apache.org> * nit Signed-off-by: Kevin Su <pingsutw@apache.org> * fix Signed-off-by: Kevin Su <pingsutw@apache.org> * fix Signed-off-by: Kevin Su <pingsutw@apache.org> --------- Signed-off-by: Kevin Su <pingsutw@apache.org>
1 parent 5981c35 commit 1329476

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

go/tasks/plugins/webapi/databricks/plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest weba
183183
}
184184

185185
func (p Plugin) Delete(ctx context.Context, taskCtx webapi.DeleteContext) error {
186+
if taskCtx.ResourceMeta() == nil {
187+
return nil
188+
}
186189
exec := taskCtx.ResourceMeta().(ResourceMetaWrapper)
187190
req, err := buildRequest(post, nil, p.cfg.databricksEndpoint,
188191
p.cfg.DatabricksInstance, exec.Token, exec.RunID, true)

go/tasks/plugins/webapi/snowflake/plugin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest weba
167167
}
168168

169169
func (p Plugin) Delete(ctx context.Context, taskCtx webapi.DeleteContext) error {
170+
if taskCtx.ResourceMeta() == nil {
171+
return nil
172+
}
170173
exec := taskCtx.ResourceMeta().(*ResourceMetaWrapper)
171174
req, err := buildRequest(post, QueryInfo{}, p.cfg.snowflakeEndpoint,
172175
exec.Account, exec.Token, exec.QueryID, true)

0 commit comments

Comments
 (0)