Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfeng-db committed Sep 4, 2024
1 parent bb871e1 commit 3c65d96
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/acceptance/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ type Step struct {
ImportState bool
ImportStateVerify bool
ProtoV6ProviderFactories map[string]func() (tfprotov6.ProviderServer, error)
// Necessary for ImportState
ResourceName string
}

func createUuid() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func (d *QualityMonitorResource) Configure(ctx context.Context, req resource.Con
}
}

func (d *QualityMonitorResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) {
resource.ImportStatePassthroughID(ctx, path.Root("table_name"), req, resp)
}

func (r *QualityMonitorResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
w, diags := r.Client.GetWorkspaceClient()
resp.Diagnostics.Append(diags...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,26 @@ func TestUcAccUpdateQualityMonitorPluginFramework(t *testing.T) {
`,
})
}

func TestUcAccQualityMonitorImportPluginFramework(t *testing.T) {
if os.Getenv("GOOGLE_CREDENTIALS") != "" {
t.Skipf("databricks_quality_monitor resource is not available on GCP")
}
acceptance.UnityWorkspaceLevel(t, acceptance.Step{
Template: commonPartQualityMonitoring + `
resource "databricks_quality_monitor_pluginframework" "testMonitorInference" {
table_name = databricks_sql_table.myInferenceTable.id
assets_dir = "/Shared/provider-test/databricks_quality_monitoring/${databricks_sql_table.myInferenceTable.name}"
output_schema_name = databricks_schema.things.id
inference_log = {
granularities = ["1 day"]
timestamp_col = "timestamp"
prediction_col = "prediction"
model_id_col = "model_id"
problem_type = "PROBLEM_TYPE_REGRESSION"
}
}
`,
})
}

0 comments on commit 3c65d96

Please sign in to comment.