Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkats-db committed Dec 20, 2024
1 parent e0b6fad commit 2abe91d
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions bundle/config/mutator/apply_presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
prefix := t.NamePrefix
tags := toTagArray(t.Tags)

// Jobs presets.
// Supported: Prefix, Tags, JobsMaxConcurrentRuns, TriggerPauseStatus
// Jobs presets: Prefix, Tags, JobsMaxConcurrentRuns, TriggerPauseStatus
for key, j := range r.Jobs {
if j.JobSettings == nil {
diags = diags.Extend(diag.Errorf("job %s is not defined", key))
Expand Down Expand Up @@ -102,8 +101,7 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
}
}

// Models presets
// Supported: Prefix, Tags
// Models presets: Prefix, Tags
for key, m := range r.Models {
if m.Model == nil {
diags = diags.Extend(diag.Errorf("model %s is not defined", key))
Expand All @@ -121,8 +119,8 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
}
}

// Experiments presets
// Supported: Prefix, Tags
// Model serving endpoint presets: Prefix
// Not supported: Tags (not in API as of 2024-12)
for key, e := range r.Experiments {
if e.Experiment == nil {
diags = diags.Extend(diag.Errorf("experiment %s is not defined", key))
Expand Down Expand Up @@ -150,9 +148,8 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
}
}

// Model serving endpoint presets
// Supported: Prefix
// Not supported: Tags (not in API as of 2024-10)
// Model serving endpoint presets: Prefix
// Not supported: Tags (not in API as of 2024-12)
for key, e := range r.ModelServingEndpoints {
if e.CreateServingEndpoint == nil {
diags = diags.Extend(diag.Errorf("model serving endpoint %s is not defined", key))
Expand All @@ -161,9 +158,8 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
e.Name = normalizePrefix(prefix) + e.Name
}

// Registered models presets
// Supported: Prefix
// Not supported: Tags (not in API as of 2024-10)
// Registered models presets: Prefix
// Not supported: Tags (not in API as of 2024-12)
for key, m := range r.RegisteredModels {
if m.CreateRegisteredModelRequest == nil {
diags = diags.Extend(diag.Errorf("registered model %s is not defined", key))
Expand All @@ -172,9 +168,8 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
m.Name = normalizePrefix(prefix) + m.Name
}

// Quality monitors presets
// Supported: Schedule
// Not supported: Tags (not in API as of 2024-10)
// Quality monitors presets: Schedule
// Not supported: Tags (not in API as of 2024-12)
for key, q := range r.QualityMonitors {
if q.CreateMonitor == nil {
diags = diags.Extend(diag.Errorf("quality monitor %s is not defined", key))
Expand All @@ -190,8 +185,8 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
}
}

// Schemas: Prefix only
// Not supported: Tags (as of 2024-10, only supported in Databricks UI / SQL API)
// Schemas: Prefix
// Not supported: Tags (as of 2024-12, only supported in Databricks UI / SQL API)
for key, s := range r.Schemas {
if s.CreateSchema == nil {
diags = diags.Extend(diag.Errorf("schema %s is not defined", key))
Expand Down

0 comments on commit 2abe91d

Please sign in to comment.