-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_fivetran_gcf_main.py
32 lines (29 loc) · 1.12 KB
/
test_fivetran_gcf_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import fivetran_gcf_main as fgm
import config
import json
print('***** CALLING FIVETRAN GOOGLE CLOUD FUNCTION TO TEST A TREND DETECTION *****')
event = {'ANALYSIS_ID': '', 'API_KEY': config.API_KEY, 'EXECUTE_ANALYSIS': 'False', 'RETURN_RESULTS': 'True'}
req_dict = {
'agent': 'Fivetran Google Cloud Functions Connector/<external_id>/<schema>',
'state': {
'cursor': '2020-01-01T00:00:00Z'
},
'secrets': event,
'sync_id': '468b681-c376-4117-bbc0-25d8ae02ace1'
}
req = json.dumps(req_dict, default=str)
response = json.dumps(fgm.main(req), default=str)
print('***** RESPONSE: ' + response)
print('***** CALLING FIVETRAN GOOGLE CLOUD FUNCTION TO TEST A TIME COMPARE *****')
event = {'ANALYSIS_ID': '', 'API_KEY': config.API_KEY, 'EXECUTE_ANALYSIS': 'False', 'RETURN_RESULTS': 'True'}
req_dict = {
'agent': 'Fivetran Google Cloud Functions Connector/<external_id>/<schema>',
'state': {
'cursor': '2020-01-01T00:00:00Z'
},
'secrets': event,
'sync_id': '468b681-c376-4117-bbc0-25d8ae02ace1'
}
req = json.dumps(req_dict, default=str)
response = fgm.main(req)
print('***** RESPONSE: ' + response)