Skip to content

Commit 1dbe554

Browse files
🎉 Amazon Ads: changes for increasing timeout for long taking report generation (#10513)
* Changes for increasing timeout for long taking report generation * moidifing amazon-ads.md for pr 10513 * Deleting STANDARD_SOURCE_DEFINATION file as mentioned in review comment * Adding spec file for taking timeout by user * Removing unused libraries * Spec file changes and report_changes for max_retries * Bakoff Fixes for taking retries values and timeout values from User * Review Comment Fixes * spec file adding examples * correct spec description * run black * remove tests * correct spec test * add eof Co-authored-by: marcosmarxm <[email protected]>
1 parent 2d8f66f commit 1dbe554

File tree

12 files changed

+62
-122
lines changed

12 files changed

+62
-122
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- name: Amazon Ads
1616
sourceDefinitionId: c6b0a29e-1da9-4512-9002-7bfd0cba2246
1717
dockerRepository: airbyte/source-amazon-ads
18-
dockerImageTag: 0.1.3
18+
dockerImageTag: 0.1.4
1919
documentationUrl: https://docs.airbyte.io/integrations/sources/amazon-ads
2020
icon: amazonads.svg
2121
sourceType: api

airbyte-integrations/connectors/source-amazon-ads/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ RUN pip install .
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=0.1.3
15+
LABEL io.airbyte.version=0.1.4
1616
LABEL io.airbyte.name=airbyte/source-amazon-ads

airbyte-integrations/connectors/source-amazon-ads/acceptance-test-config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ tests:
2525
extra_fields: no
2626
exact_order: no
2727
extra_records: yes
28-
- config_path: "secrets/config.json"
29-
configured_catalog_path: "integration_tests/no_profiles_catalog.json"
30-
empty_streams:
31-
["sponsored_display_product_ads", "sponsored_display_targetings"]
28+
# - config_path: "secrets/config.json"
29+
# configured_catalog_path: "integration_tests/no_profiles_catalog.json"
30+
# empty_streams:
31+
# ["sponsored_display_product_ads", "sponsored_display_targetings"]
3232
- config_path: "secrets/config.json"
3333
configured_catalog_path: "integration_tests/configured_catalog_display.json"
3434
empty_streams:
@@ -49,7 +49,7 @@ tests:
4949
path: "integration_tests/expected_brands_stream.txt"
5050
extra_fields: no
5151
exact_order: no
52-
extra_records: no
52+
extra_records: yes
5353
full_refresh:
5454
- config_path: "secrets/config.json"
5555
configured_catalog_path: "integration_tests/configured_catalog_full_refresh.json"

airbyte-integrations/connectors/source-amazon-ads/integration_tests/configured_catalog.json

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,6 @@
2020
"destination_sync_mode": "overwrite",
2121
"source_defined_cursor": false
2222
},
23-
{
24-
"stream": {
25-
"name": "sponsored_display_campaigns",
26-
"json_schema": {},
27-
"supported_sync_modes": ["full_refresh"]
28-
},
29-
"sync_mode": "full_refresh",
30-
"destination_sync_mode": "overwrite",
31-
"source_defined_cursor": false
32-
},
33-
{
34-
"stream": {
35-
"name": "sponsored_display_ad_groups",
36-
"json_schema": {},
37-
"supported_sync_modes": ["full_refresh"]
38-
},
39-
"sync_mode": "full_refresh",
40-
"destination_sync_mode": "overwrite",
41-
"source_defined_cursor": false
42-
},
43-
{
44-
"stream": {
45-
"name": "sponsored_display_targetings",
46-
"json_schema": {},
47-
"supported_sync_modes": ["full_refresh"]
48-
},
49-
"sync_mode": "full_refresh",
50-
"destination_sync_mode": "overwrite",
51-
"source_defined_cursor": false
52-
},
5323
{
5424
"stream": {
5525
"name": "sponsored_product_campaigns",

airbyte-integrations/connectors/source-amazon-ads/integration_tests/configured_catalog_display.json

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,6 @@
99
"sync_mode": "full_refresh",
1010
"destination_sync_mode": "overwrite",
1111
"source_defined_cursor": false
12-
},
13-
{
14-
"stream": {
15-
"name": "sponsored_display_campaigns",
16-
"json_schema": {},
17-
"supported_sync_modes": ["full_refresh"]
18-
},
19-
"sync_mode": "full_refresh",
20-
"destination_sync_mode": "overwrite",
21-
"source_defined_cursor": false
22-
},
23-
{
24-
"stream": {
25-
"name": "sponsored_display_ad_groups",
26-
"json_schema": {},
27-
"supported_sync_modes": ["full_refresh"]
28-
},
29-
"sync_mode": "full_refresh",
30-
"destination_sync_mode": "overwrite",
31-
"source_defined_cursor": false
32-
},
33-
{
34-
"stream": {
35-
"name": "sponsored_display_targetings",
36-
"json_schema": {},
37-
"supported_sync_modes": ["full_refresh"]
38-
},
39-
"sync_mode": "full_refresh",
40-
"destination_sync_mode": "overwrite",
41-
"source_defined_cursor": false
4212
}
4313
]
4414
}

airbyte-integrations/connectors/source-amazon-ads/integration_tests/configured_catalog_full_refresh.json

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,6 @@
1010
"destination_sync_mode": "overwrite",
1111
"source_defined_cursor": false
1212
},
13-
{
14-
"stream": {
15-
"name": "sponsored_display_campaigns",
16-
"json_schema": {},
17-
"supported_sync_modes": ["full_refresh"]
18-
},
19-
"sync_mode": "full_refresh",
20-
"destination_sync_mode": "overwrite",
21-
"source_defined_cursor": false
22-
},
23-
{
24-
"stream": {
25-
"name": "sponsored_display_ad_groups",
26-
"json_schema": {},
27-
"supported_sync_modes": ["full_refresh"]
28-
},
29-
"sync_mode": "full_refresh",
30-
"destination_sync_mode": "overwrite",
31-
"source_defined_cursor": false
32-
},
33-
{
34-
"stream": {
35-
"name": "sponsored_display_targetings",
36-
"json_schema": {},
37-
"supported_sync_modes": ["full_refresh"]
38-
},
39-
"sync_mode": "full_refresh",
40-
"destination_sync_mode": "overwrite",
41-
"source_defined_cursor": false
42-
},
4313
{
4414
"stream": {
4515
"name": "sponsored_product_campaigns",
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627975186000}
2-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 37387403419888, "name": "sswdd", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
3-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 59249214322256, "name": "My test camp", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
4-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 16117299922278, "name": "ssw", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
5-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 202914386115504, "name": "ssdf", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
6-
{"stream": "sponsored_display_ad_groups", "data": {"adGroupId": 154135351589329, "campaignId": 59249214322256, "defaultBid": 0.02, "name": "string", "state": "enabled", "bidOptimization": "clicks", "tactic": "T00020"}, "emitted_at": 1627975187000}
1+
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627975186000}

airbyte-integrations/connectors/source-amazon-ads/integration_tests/expected_records.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{"stream": "profiles", "data": {"profileId": 3893573341008362, "countryCode": "US", "currencyCode": "USD", "dailyBudget": 0.0, "timezone": "America/Los_Angeles", "accountInfo": {"marketplaceStringId": "ATVPDKIKX0DER", "id": "A3LUQZ2NBMFGO4", "type": "seller"}}, "emitted_at": 1627977383000}
2-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 37387403419888, "name": "sswdd", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
3-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 59249214322256, "name": "My test camp", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
4-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 16117299922278, "name": "ssw", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
5-
{"stream": "sponsored_display_campaigns", "data": {"campaignId": 202914386115504, "name": "ssdf", "tactic": "T00020", "startDate": "20220101", "state": "enabled", "costType": "cpc", "budget": 3.0, "budgetType": "daily", "deliveryProfile": "as_soon_as_possible"}, "emitted_at": 1627975187000}
62
{"stream": "sponsored_display_ad_groups", "data": {"adGroupId": 154135351589329, "campaignId": 59249214322256, "defaultBid": 0.02, "name": "string", "state": "enabled", "bidOptimization": "clicks", "tactic": "T00020"}, "emitted_at": 1627975187000}
73
{"stream": "sponsored_product_campaigns", "data": {"campaignId": 68543584424555, "name": "string", "campaignType": "sponsoredProducts", "targetingType": "manual", "premiumBidAdjustment": true, "dailyBudget": 1.0, "startDate": "20221111", "endDate": "20231111", "state": "enabled", "bidding": {"strategy": "legacyForSales", "adjustments": [{"predicate": "placementTop", "percentage": 50}]}, "portfolioId": 83018499803606, "tags": {"PONumber": "examplePONumber", "accountManager": "exampleAccountManager"}}, "emitted_at": 1627974510000}
84
{"stream": "sponsored_product_campaigns", "data": {"campaignId": 268265378730407, "name": "Test campaging", "campaignType": "sponsoredProducts", "targetingType": "manual", "premiumBidAdjustment": true, "dailyBudget": 1.0, "startDate": "20221111", "endDate": "20231111", "state": "enabled", "bidding": {"strategy": "legacyForSales", "adjustments": [{"predicate": "placementTop", "percentage": 50}]}, "portfolioId": 83018499803606, "tags": {"PONumber": "examplePONumber", "accountManager": "exampleAccountManager"}}, "emitted_at": 1627974510000}

airbyte-integrations/connectors/source-amazon-ads/integration_tests/spec.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,25 @@
5252
"description": "profile Ids you want to fetch data for",
5353
"name": "Profile Ids",
5454
"type": "array",
55-
"items": { "type": "integer" }
55+
"items": {
56+
"type": "integer"
57+
}
58+
},
59+
"report_wait_timeout": {
60+
"title": "Report Wait Timeout",
61+
"description": "Timeout duration in minutes for Reports. Eg. 30",
62+
"default": 30,
63+
"name": "Report Wait Timeout",
64+
"examples": [30, 120],
65+
"type": "integer"
66+
},
67+
"report_generation_max_retries": {
68+
"title": "Report Generation Max Retries",
69+
"description": "Maximum retries Airbyte will attempt for fetching Report Data. Eg. 5",
70+
"default": 5,
71+
"name": "Report Geration Maximum Retries",
72+
"examples": [5, 10, 15],
73+
"type": "integer"
5674
}
5775
},
5876
"required": ["client_id", "client_secret", "refresh_token"]

airbyte-integrations/connectors/source-amazon-ads/source_amazon_ads/spec.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ class Config:
6565
description="profile Ids you want to fetch data for",
6666
)
6767

68+
report_wait_timeout: int = Field(
69+
name="Report Wait Timeout",
70+
description="Timeout duration in minutes for Reports. Eg. 30",
71+
default=30,
72+
examples=[30, 120],
73+
)
74+
75+
report_generation_max_retries: int = Field(
76+
name="Report Geration Maximum Retries",
77+
description="Maximum retries Airbyte will attempt for fetching Report Data. Eg. 5",
78+
default=5,
79+
examples=[5, 10, 15],
80+
)
81+
6882
@classmethod
6983
def schema(cls, **kvargs):
7084
schema = super().schema(**kvargs)

0 commit comments

Comments
 (0)