Skip to content

Commit 9dacd5d

Browse files
author
Baz
authored
🐛 Source Bing-Ads: fix hourly reports for all reports streams (#15602)
1 parent 3c9c5d4 commit 9dacd5d

File tree

8 files changed

+131
-7
lines changed

8 files changed

+131
-7
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
@@ -104,7 +104,7 @@
104104
- name: Bing Ads
105105
sourceDefinitionId: 47f25999-dd5e-4636-8c39-e7cea2453331
106106
dockerRepository: airbyte/source-bing-ads
107-
dockerImageTag: 0.1.9
107+
dockerImageTag: 0.1.10
108108
documentationUrl: https://docs.airbyte.io/integrations/sources/bing-ads
109109
icon: bingads.svg
110110
sourceType: api

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@
865865
- "overwrite"
866866
- "append"
867867
- "append_dedup"
868-
- dockerImage: "airbyte/source-bing-ads:0.1.9"
868+
- dockerImage: "airbyte/source-bing-ads:0.1.10"
869869
spec:
870870
documentationUrl: "https://docs.airbyte.io/integrations/sources/bing-ads"
871871
connectionSpecification:

airbyte-integrations/connectors/source-bing-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.9
15+
LABEL io.airbyte.version=0.1.10
1616
LABEL io.airbyte.name=airbyte/source-bing-ads

airbyte-integrations/connectors/source-bing-ads/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
9696
Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named.
9797
First install test dependencies into your virtual environment:
9898
```
99-
pip install .[tests]
99+
pip install ".[tests]"
100100
```
101101
### Unit Tests
102102
To run unit tests locally, from the connector directory run:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ tests:
1414
basic_read:
1515
- config_path: "secrets/config.json"
1616
configured_catalog_path: "integration_tests/configured_catalog.json"
17-
# incremental test doesn't work if a single stream has multiple states
17+
empty_streams: ["account_performance_report_hourly","ad_group_performance_report_hourly","ad_performance_report_hourly","campaign_performance_report_hourly","keyword_performance_report_hourly"]
18+
# incremental test doesn"t work if a single stream has multiple states
1819
#incremental:
1920
# - config_path: "secrets/config.json"
2021
# configured_catalog_path: "integration_tests/configured_catalog.json"

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

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@
3636
"sync_mode": "full_refresh",
3737
"destination_sync_mode": "append"
3838
},
39+
{
40+
"stream": {
41+
"name": "account_performance_report_hourly",
42+
"json_schema": {},
43+
"supported_sync_modes": ["incremental", "full_refresh"]
44+
},
45+
"sync_mode": "incremental",
46+
"cursor_field": ["TimePeriod"],
47+
"destination_sync_mode": "append"
48+
},
49+
{
50+
"stream": {
51+
"name": "account_performance_report_daily",
52+
"json_schema": {},
53+
"supported_sync_modes": ["incremental", "full_refresh"]
54+
},
55+
"sync_mode": "incremental",
56+
"cursor_field": ["TimePeriod"],
57+
"destination_sync_mode": "append"
58+
},
3959
{
4060
"stream": {
4161
"name": "account_performance_report_weekly",
@@ -56,6 +76,26 @@
5676
"cursor_field": ["TimePeriod"],
5777
"destination_sync_mode": "append"
5878
},
79+
{
80+
"stream": {
81+
"name": "ad_group_performance_report_hourly",
82+
"json_schema": {},
83+
"supported_sync_modes": ["incremental", "full_refresh"]
84+
},
85+
"sync_mode": "incremental",
86+
"cursor_field": ["TimePeriod"],
87+
"destination_sync_mode": "append"
88+
},
89+
{
90+
"stream": {
91+
"name": "ad_group_performance_report_daily",
92+
"json_schema": {},
93+
"supported_sync_modes": ["incremental", "full_refresh"]
94+
},
95+
"sync_mode": "incremental",
96+
"cursor_field": ["TimePeriod"],
97+
"destination_sync_mode": "append"
98+
},
5999
{
60100
"stream": {
61101
"name": "ad_group_performance_report_weekly",
@@ -76,6 +116,26 @@
76116
"cursor_field": ["TimePeriod"],
77117
"destination_sync_mode": "append"
78118
},
119+
{
120+
"stream": {
121+
"name": "ad_performance_report_hourly",
122+
"json_schema": {},
123+
"supported_sync_modes": ["incremental", "full_refresh"]
124+
},
125+
"sync_mode": "incremental",
126+
"cursor_field": ["TimePeriod"],
127+
"destination_sync_mode": "append"
128+
},
129+
{
130+
"stream": {
131+
"name": "ad_performance_report_daily",
132+
"json_schema": {},
133+
"supported_sync_modes": ["incremental", "full_refresh"]
134+
},
135+
"sync_mode": "incremental",
136+
"cursor_field": ["TimePeriod"],
137+
"destination_sync_mode": "append"
138+
},
79139
{
80140
"stream": {
81141
"name": "ad_performance_report_weekly",
@@ -106,6 +166,26 @@
106166
"cursor_field": ["TimePeriod"],
107167
"destination_sync_mode": "append"
108168
},
169+
{
170+
"stream": {
171+
"name": "campaign_performance_report_hourly",
172+
"json_schema": {},
173+
"supported_sync_modes": ["incremental", "full_refresh"]
174+
},
175+
"sync_mode": "incremental",
176+
"cursor_field": ["TimePeriod"],
177+
"destination_sync_mode": "append"
178+
},
179+
{
180+
"stream": {
181+
"name": "campaign_performance_report_daily",
182+
"json_schema": {},
183+
"supported_sync_modes": ["incremental", "full_refresh"]
184+
},
185+
"sync_mode": "incremental",
186+
"cursor_field": ["TimePeriod"],
187+
"destination_sync_mode": "append"
188+
},
109189
{
110190
"stream": {
111191
"name": "campaign_performance_report_weekly",
@@ -126,6 +206,26 @@
126206
"cursor_field": ["TimePeriod"],
127207
"destination_sync_mode": "append"
128208
},
209+
{
210+
"stream": {
211+
"name": "keyword_performance_report_hourly",
212+
"json_schema": {},
213+
"supported_sync_modes": ["incremental", "full_refresh"]
214+
},
215+
"sync_mode": "incremental",
216+
"cursor_field": ["TimePeriod"],
217+
"destination_sync_mode": "append"
218+
},
219+
{
220+
"stream": {
221+
"name": "keyword_performance_report_daily",
222+
"json_schema": {},
223+
"supported_sync_modes": ["incremental", "full_refresh"]
224+
},
225+
"sync_mode": "incremental",
226+
"cursor_field": ["TimePeriod"],
227+
"destination_sync_mode": "append"
228+
},
129229
{
130230
"stream": {
131231
"name": "keyword_performance_report_weekly",

airbyte-integrations/connectors/source-bing-ads/source_bing_ads/source.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ class CampaignPerformanceReport(ReportsMixin, BingAdsStream):
382382
*AVERAGE_FIELDS,
383383
*CONVERSION_FIELDS,
384384
*LOW_QUALITY_FIELDS,
385-
*HISTORICAL_FIELDS,
386385
*REVENUE_FIELDS,
387386
*BUDGET_FIELDS,
388387
]
@@ -394,14 +393,26 @@ class CampaignPerformanceReportHourly(CampaignPerformanceReport):
394393

395394
class CampaignPerformanceReportDaily(CampaignPerformanceReport):
396395
report_aggregation = "Daily"
396+
report_columns = [
397+
*CampaignPerformanceReport.report_columns,
398+
*HISTORICAL_FIELDS,
399+
]
397400

398401

399402
class CampaignPerformanceReportWeekly(CampaignPerformanceReport):
400403
report_aggregation = "Weekly"
404+
report_columns = [
405+
*CampaignPerformanceReport.report_columns,
406+
*HISTORICAL_FIELDS,
407+
]
401408

402409

403410
class CampaignPerformanceReportMonthly(CampaignPerformanceReport):
404411
report_aggregation = "Monthly"
412+
report_columns = [
413+
*CampaignPerformanceReport.report_columns,
414+
*HISTORICAL_FIELDS,
415+
]
405416

406417

407418
class AdPerformanceReport(ReportsMixin, BingAdsStream):
@@ -522,7 +533,6 @@ class AdGroupPerformanceReport(ReportsMixin, BingAdsStream):
522533
*ALL_REVENUE_FIELDS,
523534
*AVERAGE_FIELDS,
524535
*CONVERSION_FIELDS,
525-
*HISTORICAL_FIELDS,
526536
*REVENUE_FIELDS,
527537
]
528538

@@ -533,14 +543,26 @@ class AdGroupPerformanceReportHourly(AdGroupPerformanceReport):
533543

534544
class AdGroupPerformanceReportDaily(AdGroupPerformanceReport):
535545
report_aggregation = "Daily"
546+
report_columns = [
547+
*AdGroupPerformanceReport.report_columns,
548+
*HISTORICAL_FIELDS,
549+
]
536550

537551

538552
class AdGroupPerformanceReportWeekly(AdGroupPerformanceReport):
539553
report_aggregation = "Weekly"
554+
report_columns = [
555+
*AdGroupPerformanceReport.report_columns,
556+
*HISTORICAL_FIELDS,
557+
]
540558

541559

542560
class AdGroupPerformanceReportMonthly(AdGroupPerformanceReport):
543561
report_aggregation = "Monthly"
562+
report_columns = [
563+
*AdGroupPerformanceReport.report_columns,
564+
*HISTORICAL_FIELDS,
565+
]
544566

545567

546568
class KeywordPerformanceReport(ReportsMixin, BingAdsStream):

docs/integrations/sources/bing-ads.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ API limits number of requests for all Microsoft Advertising clients. You can fin
105105

106106
| Version | Date | Pull Request | Subject |
107107
| :------ | :--------- | :------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
108+
| 0.1.10 | 2022-08-12 | [15602](https://github.com/airbytehq/airbyte/pull/15602) | Fixed bug caused Hourly Reports to crash due to invalid fields set
108109
| 0.1.9 | 2022-08-02 | [14862](https://github.com/airbytehq/airbyte/pull/14862) | Added missing columns |
109110
| 0.1.8 | 2022-06-15 | [13801](https://github.com/airbytehq/airbyte/pull/13801) | All reports `hourly/daily/weekly/monthly` will be generated by default, these options are removed from input configuration |
110111
| 0.1.7 | 2022-05-17 | [12937](https://github.com/airbytehq/airbyte/pull/12937) | Added OAuth2.0 authentication method, removed `redirect_uri` from input configuration |

0 commit comments

Comments
 (0)