1...
2 schedule = "0 23 * * *"
3 haltOnNewColAdd = True
4 jobRes, err = jobclient.CreateJob(ctx, connect.NewRequest({
5 'AccountId': accountId,
6 'JobName': 'prod-to-stage',
7 'ConnectionSourceId': prodDbResp['Msg']['Connection']['Id'],
8 'DestinationSourceIds': [
9 stageDbResp['Msg']['Connection']['Id'],
10 s3Resp['Msg']['Connection']['Id'],
11 ],
12 'CronSchedule': schedule,
13 'HaltOnNewColumnAddition': haltOnNewColAdd,
14 'Mappings': [
15 {
16 'Schema': 'public',
17 'Table': 'users',
18 'Column': 'account_number',
19 'Transformer': JobMappingTransformer.custom_account_number,
20 },
21 {
22 'Schema': 'public',
23 'Table': 'users',
24 'Column': 'address',
25 'Transformer': JobMappingTransformer.address_anonymize,
26 },
27 ],
28 }))
29 if err:
30 raise Exception(err)
31...