diff --git a/catalog/resource_quality_monitor.go b/catalog/resource_quality_monitor.go index 1d2beffc4..c385a83a9 100644 --- a/catalog/resource_quality_monitor.go +++ b/catalog/resource_quality_monitor.go @@ -100,6 +100,9 @@ func ResourceQualityMonitor() common.Resource { var update catalog.UpdateMonitor common.DataToStructPointer(d, monitorSchema, &update) update.TableName = d.Get("table_name").(string) + if update.Schedule != nil { + update.Schedule.PauseStatus = "" + } _, err = w.QualityMonitors.Update(ctx, update) if err != nil { return err diff --git a/internal/acceptance/quality_monitor_test.go b/internal/acceptance/quality_monitor_test.go index d9e8a62c5..a0ebb198b 100644 --- a/internal/acceptance/quality_monitor_test.go +++ b/internal/acceptance/quality_monitor_test.go @@ -64,6 +64,10 @@ func TestUcAccQualityMonitor(t *testing.T) { model_id_col = "model_id" problem_type = "PROBLEM_TYPE_REGRESSION" } + schedule=MonitorCronSchedule( + quartz_cron_expression="0 0 12 * * ?", # schedules a refresh every day at 12 noon + timezone_id="PST" + ) } resource "databricks_sql_table" "myTimeseries" { @@ -87,6 +91,10 @@ func TestUcAccQualityMonitor(t *testing.T) { granularities = ["1 day"] timestamp_col = "timestamp" } + schedule=MonitorCronSchedule( + quartz_cron_expression="0 0 12 * * ?", # schedules a refresh every day at 12 noon + timezone_id="PST" + ) } resource "databricks_sql_table" "mySnapshot" { diff --git a/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go index 7a0445ddb..8f6551922 100644 --- a/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go +++ b/internal/providers/pluginfw/products/qualitymonitor/resource_quality_monitor.go @@ -195,6 +195,9 @@ func (r *QualityMonitorResource) Update(ctx context.Context, req resource.Update if resp.Diagnostics.HasError() { return } + if updateMonitorGoSDK.Schedule != nil { + updateMonitorGoSDK.Schedule.PauseStatus = "" + } monitor, err := w.QualityMonitors.Update(ctx, updateMonitorGoSDK) if err != nil { resp.Diagnostics.AddError("failed to update monitor", err.Error())