Skip to content

Commit

Permalink
🐛 Source Bing-Ads: fix hourly reports for all reports streams (#15602)
Browse files Browse the repository at this point in the history
  • Loading branch information
bazarnov authored Aug 12, 2022
1 parent 3c9c5d4 commit 9dacd5d
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
- name: Bing Ads
sourceDefinitionId: 47f25999-dd5e-4636-8c39-e7cea2453331
dockerRepository: airbyte/source-bing-ads
dockerImageTag: 0.1.9
dockerImageTag: 0.1.10
documentationUrl: https://docs.airbyte.io/integrations/sources/bing-ads
icon: bingads.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@
- "overwrite"
- "append"
- "append_dedup"
- dockerImage: "airbyte/source-bing-ads:0.1.9"
- dockerImage: "airbyte/source-bing-ads:0.1.10"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/bing-ads"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-bing-ads/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.9
LABEL io.airbyte.version=0.1.10
LABEL io.airbyte.name=airbyte/source-bing-ads
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-bing-ads/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/integration_tests:/integrat
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.
First install test dependencies into your virtual environment:
```
pip install .[tests]
pip install ".[tests]"
```
### Unit Tests
To run unit tests locally, from the connector directory run:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ tests:
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
# incremental test doesn't work if a single stream has multiple states
empty_streams: ["account_performance_report_hourly","ad_group_performance_report_hourly","ad_performance_report_hourly","campaign_performance_report_hourly","keyword_performance_report_hourly"]
# incremental test doesn"t work if a single stream has multiple states
#incremental:
# - config_path: "secrets/config.json"
# configured_catalog_path: "integration_tests/configured_catalog.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "account_performance_report_hourly",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "account_performance_report_daily",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "account_performance_report_weekly",
Expand All @@ -56,6 +76,26 @@
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_group_performance_report_hourly",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_group_performance_report_daily",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_group_performance_report_weekly",
Expand All @@ -76,6 +116,26 @@
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_performance_report_hourly",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_performance_report_daily",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_performance_report_weekly",
Expand Down Expand Up @@ -106,6 +166,26 @@
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "campaign_performance_report_hourly",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "campaign_performance_report_daily",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "campaign_performance_report_weekly",
Expand All @@ -126,6 +206,26 @@
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "keyword_performance_report_hourly",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "keyword_performance_report_daily",
"json_schema": {},
"supported_sync_modes": ["incremental", "full_refresh"]
},
"sync_mode": "incremental",
"cursor_field": ["TimePeriod"],
"destination_sync_mode": "append"
},
{
"stream": {
"name": "keyword_performance_report_weekly",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ class CampaignPerformanceReport(ReportsMixin, BingAdsStream):
*AVERAGE_FIELDS,
*CONVERSION_FIELDS,
*LOW_QUALITY_FIELDS,
*HISTORICAL_FIELDS,
*REVENUE_FIELDS,
*BUDGET_FIELDS,
]
Expand All @@ -394,14 +393,26 @@ class CampaignPerformanceReportHourly(CampaignPerformanceReport):

class CampaignPerformanceReportDaily(CampaignPerformanceReport):
report_aggregation = "Daily"
report_columns = [
*CampaignPerformanceReport.report_columns,
*HISTORICAL_FIELDS,
]


class CampaignPerformanceReportWeekly(CampaignPerformanceReport):
report_aggregation = "Weekly"
report_columns = [
*CampaignPerformanceReport.report_columns,
*HISTORICAL_FIELDS,
]


class CampaignPerformanceReportMonthly(CampaignPerformanceReport):
report_aggregation = "Monthly"
report_columns = [
*CampaignPerformanceReport.report_columns,
*HISTORICAL_FIELDS,
]


class AdPerformanceReport(ReportsMixin, BingAdsStream):
Expand Down Expand Up @@ -522,7 +533,6 @@ class AdGroupPerformanceReport(ReportsMixin, BingAdsStream):
*ALL_REVENUE_FIELDS,
*AVERAGE_FIELDS,
*CONVERSION_FIELDS,
*HISTORICAL_FIELDS,
*REVENUE_FIELDS,
]

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

class AdGroupPerformanceReportDaily(AdGroupPerformanceReport):
report_aggregation = "Daily"
report_columns = [
*AdGroupPerformanceReport.report_columns,
*HISTORICAL_FIELDS,
]


class AdGroupPerformanceReportWeekly(AdGroupPerformanceReport):
report_aggregation = "Weekly"
report_columns = [
*AdGroupPerformanceReport.report_columns,
*HISTORICAL_FIELDS,
]


class AdGroupPerformanceReportMonthly(AdGroupPerformanceReport):
report_aggregation = "Monthly"
report_columns = [
*AdGroupPerformanceReport.report_columns,
*HISTORICAL_FIELDS,
]


class KeywordPerformanceReport(ReportsMixin, BingAdsStream):
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/bing-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ API limits number of requests for all Microsoft Advertising clients. You can fin

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
| 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
| 0.1.9 | 2022-08-02 | [14862](https://github.com/airbytehq/airbyte/pull/14862) | Added missing columns |
| 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 |
| 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 |
Expand Down

0 comments on commit 9dacd5d

Please sign in to comment.