Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix databricks plugin #4206

Merged
merged 4 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
return nil, nil, pluginErrors.Wrapf(pluginErrors.RuntimeFailure, err,
"Unable to fetch statementHandle from http response")
}
runID := fmt.Sprintf("%v", data["run_id"])
runID := fmt.Sprintf("%.0f", data["run_id"])

return ResourceMetaWrapper{runID, p.cfg.DatabricksInstance, token},
ResourceWrapper{StatusCode: resp.StatusCode}, nil
Expand All @@ -159,6 +159,7 @@
return nil, err
}
resp, err := p.client.Do(req)
logger.Debugf(ctx, "Get databricks job response", "resp", resp)

Check warning on line 162 in flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go#L162

Added line #L162 was not covered by tests
if err != nil {
logger.Errorf(ctx, "Failed to get databricks job status [%v]", resp)
return nil, err
Expand Down Expand Up @@ -224,7 +225,7 @@
case http.StatusAccepted:
return core.PhaseInfoRunning(pluginsCore.DefaultPhaseVersion, taskInfo), nil
case http.StatusOK:
if lifeCycleState == "TERMINATED" {
if lifeCycleState == "TERMINATED" || lifeCycleState == "SKIPPED" || lifeCycleState == "INTERNAL_ERROR" {

Check warning on line 228 in flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go#L228

Added line #L228 was not covered by tests
if resultState == "SUCCESS" {
if err := writeOutput(ctx, taskCtx); err != nil {
pluginsCore.PhaseInfoFailure(string(rune(statusCode)), "failed to write output", taskInfo)
Expand Down
Loading