-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TDL-14887: Respect field selection #67
base: master
Are you sure you want to change the base?
Changes from all commits
da759d3
23a93b3
f3de6a9
d08a706
e71aaf3
bf15242
6c70f73
f25c815
42714f7
bbf14a3
af3ea3b
237d8b1
eef1780
9b20b19
5f179fc
88a8630
bf8b487
2b12baf
e5a98cf
fa07e1c
b544e52
c204136
04ce605
d344f21
5290186
4630c71
087b156
612d1a8
0291021
e7d7e09
8ab8353
684f752
a59243d
4abadef
0232535
ab43995
5864acc
2a2b20c
0418198
a947b16
1a7909b
ca2ca09
3cd7436
fc9fa00
0824e00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ version: 2 | |
jobs: | ||
build: | ||
docker: | ||
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:tap-tester | ||
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester | ||
steps: | ||
- checkout | ||
- run: | ||
|
@@ -11,7 +11,7 @@ jobs: | |
python3 -mvenv /usr/local/share/virtualenvs/tap-exacttarget | ||
source /usr/local/share/virtualenvs/tap-exacttarget/bin/activate | ||
pip install -U 'pip<19.2' 'setuptools<51.0.0' | ||
pip install .[dev] | ||
pip install .[test] | ||
- run: | ||
name: 'unittest' | ||
command: | | ||
|
@@ -26,16 +26,10 @@ jobs: | |
- run: | ||
name: 'Integration Tests' | ||
command: | | ||
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/sandbox dev_env.sh | ||
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/tap_tester_sandbox dev_env.sh | ||
source dev_env.sh | ||
source /usr/local/share/virtualenvs/tap-tester/bin/activate | ||
run-test --tap=tap-exacttarget \ | ||
--target=target-stitch \ | ||
--orchestrator=stitch-orchestrator \ | ||
[email protected] \ | ||
--password=$SANDBOX_PASSWORD \ | ||
--client-id=50 \ | ||
tests | ||
run-test --tap=tap-exacttarget tests | ||
workflows: | ||
version: 2 | ||
commit: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,29 @@ | ||
import FuelSDK | ||
import copy | ||
import singer | ||
|
||
from tap_exacttarget.client import request | ||
from tap_exacttarget.dao import DataAccessObject | ||
from tap_exacttarget.schemas import with_properties | ||
from tap_exacttarget.dao import (DataAccessObject, exacttarget_error_handling) | ||
|
||
LOGGER = singer.get_logger() | ||
|
||
|
||
class CampaignDataAccessObject(DataAccessObject): | ||
|
||
SCHEMA = with_properties({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed schema. |
||
'id': { | ||
'type': ['null', 'string'], | ||
}, | ||
'createdDate': { | ||
'type': ['null', 'string'], | ||
}, | ||
'modifiedDate': { | ||
'type': ['null', 'string'], | ||
}, | ||
'name': { | ||
'type': ['null', 'string'], | ||
}, | ||
'description': { | ||
'type': ['null', 'string'], | ||
}, | ||
'campaignCode': { | ||
'type': ['null', 'string'], | ||
}, | ||
'color': { | ||
'type': ['null', 'string'], | ||
} | ||
}) | ||
|
||
TABLE = 'campaign' | ||
KEY_PROPERTIES = ['id'] | ||
REPLICATION_METHOD = 'FULL_TABLE' | ||
|
||
@exacttarget_error_handling | ||
def sync_data(self): | ||
cursor = request( | ||
'Campaign', | ||
FuelSDK.ET_Campaign, | ||
self.auth_stub) | ||
|
||
catalog_copy = copy.deepcopy(self.catalog) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do a deep copy of the catalog? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The behavior of the transform function is in such a manner (here) that when we pass catalog in transform function, it is re-ordering the data-type values for eg. before transform |
||
|
||
for campaign in cursor: | ||
campaign = self.filter_keys_and_parse(campaign) | ||
|
||
singer.write_records(self.__class__.TABLE, [campaign]) | ||
self.write_records_with_transform(campaign, catalog_copy, self.TABLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused import as the schema is removed.
Similarly for other files too.