Skip to content
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-16481 Update schema #10

Merged
merged 4 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:tap-tester-v4
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester
steps:
- checkout
- run:
Expand All @@ -12,25 +12,31 @@ jobs:
source /usr/local/share/virtualenvs/tap-activecampaign/bin/activate
pip install -U 'pip<19.2' setuptools
pip install .[dev]
- run:
name: 'JSON Validator'
command: |
source /usr/local/share/virtualenvs/tap-tester/bin/activate
stitch-validate-json tap_activecampaign/schemas/*.json
- run:
name: 'pylint'
command: |
source /usr/local/share/virtualenvs/tap-activecampaign/bin/activate
pylint tap_activecampaign -d C,R,W
- add_ssh_keys
- 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-activecampaign \
--target=target-stitch \
--orchestrator=stitch-orchestrator \
--email=harrison+sandboxtest@stitchdata.com \
--password=$SANDBOX_PASSWORD \
--client-id=50 \
tests
run-test --tap=tap-activecampaign tests
workflows:
version: 2
commit:
jobs:
- build
- build:
context:
- circleci-user
build_daily:
triggers:
- schedule:
Expand Down
18 changes: 15 additions & 3 deletions tap_activecampaign/schemas/automation_blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,21 @@
"type": ["null", "integer"]
},
"params": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {}
"anyOf": [
{
"type": ["null", "object"],
"additionalProperties": true,
"properties": {}
},
{
"type": "array",
"items": {
"type": ["null", "object"],
"additionalProperties": true,
"properties": {}
}
}
]
Comment on lines +15 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this update to schema be backward compatible?

Copy link
Contributor Author

@prijendev prijendev Jan 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have made this change just to handle the empty array value of the param field. In the existing schema, it handles only object type values that are still supported. So, now it will handle the following both possible values of the param field,

  1. "param": {"eventType": "never"}
  2. "param": []

},
"deleted": {
"type": ["null", "integer"]
Expand Down
6 changes: 3 additions & 3 deletions tap_activecampaign/schemas/brandings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "object",
"additionalProperties": false,
"properties": {
"group_id": {
"groupid": {
"type": ["null", "string"]
},
"site_name": {
Expand Down Expand Up @@ -38,13 +38,13 @@
"help": {
"type": ["null", "integer"]
},
"admin_template_httm": {
"admin_template_htm": {
"type": ["null", "string"]
},
"admin_template_css": {
"type": ["null", "string"]
},
"public_template_httm": {
"public_template_htm": {
"type": ["null", "string"]
},
"public_template_css": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/campaign_links.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"tracked": {
"type": ["null", "integer"]
},
"uniqueclicks": {
"uniquelinkclicks": {
"type": ["null", "integer"]
},
"linkclicks": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/contact_custom_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"perstag": {
"type": ["null", "string"]
},
"defvalue": {
"defval": {
"type": ["null", "string"]
},
"show_in_list": {
Expand Down
4 changes: 2 additions & 2 deletions tap_activecampaign/schemas/contact_lists.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"last_name": {
"type": ["null", "string"]
},
"ip4_sub": {
"ip_4sub": {
"type": ["null", "integer"]
},
"sourceid": {
Expand All @@ -58,7 +58,7 @@
"ip4_last": {
"type": ["null", "integer"]
},
"ip4_unsub": {
"ip_4unsub": {
"type": ["null", "integer"]
},
"created_timestamp": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/contacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"last_name": {
"type": ["null", "string"]
},
"org_id": {
"orgid": {
"type": ["null", "integer"]
},
"segmentio_id": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/conversions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"limit": {
"type": ["null", "integer"]
},
"enforce_limit": {
"enforcelimit": {
"type": ["null", "integer"]
},
"cdate": {
Expand Down
4 changes: 2 additions & 2 deletions tap_activecampaign/schemas/deal_activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"d_id": {
"type": ["null", "integer"]
},
"d_stage_id": {
"d_stageid": {
"type": ["null", "integer"]
},
"userid": {
Expand All @@ -20,7 +20,7 @@
"data_action": {
"type": ["null", "string"]
},
"data_old_val": {
"data_oldval": {
"type": ["null", "string"]
},
"cdate": {
Expand Down
10 changes: 5 additions & 5 deletions tap_activecampaign/schemas/deal_stages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"type": "object",
"additionalProperties": false,
"properties": {
"card_region_1": {
"card_region1": {
"type": ["null", "string"]
},
"card_region_2": {
"card_region2": {
"type": ["null", "string"]
},
"card_region_3": {
"card_region3": {
"type": ["null", "string"]
},
"card_region_4": {
"card_region4": {
"type": ["null", "string"]
},
"card_region_5": {
"card_region5": {
"type": ["null", "string"]
},
"cdate": {
Expand Down
4 changes: 2 additions & 2 deletions tap_activecampaign/schemas/forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"cfields": {
"anyOf": [
{
"type": "null"
"type": ["null", "object"]
},
{
"type": "array",
Expand Down Expand Up @@ -228,7 +228,7 @@
"defaultscreenshot": {
"type": ["null", "string"]
},
"recents": {
"recent": {
"anyOf": [
{
"type": "array",
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"reltype": {
"type": ["null", "string"]
},
"deal_task_type": {
"deal_tasktype": {
"type": ["null", "integer"]
},
"cdate": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"subject": {
"type": ["null", "string"]
},
"contant": {
"content": {
"type": ["null", "string"]
},
"categoryid": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/schemas/users.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"signature": {
"type": ["null", "string"]
},
"local_zone_id": {
"local_zoneid": {
"type": ["null", "string"]
},
"password_updated_utc_timestamp": {
Expand Down
2 changes: 1 addition & 1 deletion tap_activecampaign/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def transform_json(this_json, stream_name, data_key):
else:
converted_json = humps.decamelize(this_json)

fixed_records = fix_records(converted_json)
fix_records(converted_json)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed pylint error assignment-from-no-return. (Reference)


return converted_json
Empty file removed tests/__init__.py
Empty file.
Loading