@@ -17,7 +17,6 @@ type ResourceJob struct {
1717func NewResourceJob (client * databricks.WorkspaceClient , job * resources.Job ) (* ResourceJob , error ) {
1818 return & ResourceJob {
1919 client : client ,
20- // TODO Use Processor with explicit field mapping
2120 config : job .JobSettings ,
2221 }, nil
2322}
@@ -65,6 +64,8 @@ func (r *ResourceJob) WaitAfterUpdate(ctx context.Context) error {
6564}
6665
6766func makeCreateJob (config jobs.JobSettings ) (jobs.CreateJob , error ) {
67+ // Note, exhaustruct linter validates that all off CreateJob fields are initialized.
68+ // We don't have linter that validates that all of config fields are used.
6869 result := jobs.CreateJob {
6970 AccessControlList : nil , // Not supported by DABs
7071 BudgetPolicyId : config .BudgetPolicyId ,
@@ -92,12 +93,9 @@ func makeCreateJob(config jobs.JobSettings) (jobs.CreateJob, error) {
9293 Trigger : config .Trigger ,
9394 UsagePolicyId : config .UsagePolicyId ,
9495 WebhookNotifications : config .WebhookNotifications ,
95-
96- ForceSendFields : filterFields [jobs.CreateJob ](config .ForceSendFields ),
96+ ForceSendFields : filterFields [jobs.CreateJob ](config .ForceSendFields ),
9797 }
9898
99- // TODO: Validate copy - all fields must be initialized or explicitly allowed to be empty
100- // Unset AccessControlList
10199 return result , nil
102100}
103101
@@ -106,7 +104,9 @@ func makeResetJob(config jobs.JobSettings, id string) (jobs.ResetJob, error) {
106104 if err != nil {
107105 return jobs.ResetJob {}, err
108106 }
109- result := jobs.ResetJob {JobId : idInt , NewSettings : config }
110- // TODO: Validate copy - all fields must be initialized or explicitly allowed to be empty
107+ result := jobs.ResetJob {
108+ JobId : idInt ,
109+ NewSettings : config ,
110+ }
111111 return result , err
112112}
0 commit comments