Skip to content

Commit 729dacd

Browse files
marcosmarxmMaxKrog
andauthored
Bump Google Ads (connector skip dates) (#5502)
* Fix issue 5411: Connector skipping dates * bump version Co-authored-by: MaxKrog <[email protected]>
1 parent 69b6629 commit 729dacd

File tree

7 files changed

+24
-4
lines changed

7 files changed

+24
-4
lines changed

airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/253487c0-2246-43ba-a21f-5116b20a2c50.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"sourceDefinitionId": "253487c0-2246-43ba-a21f-5116b20a2c50",
33
"name": "Google Ads",
44
"dockerRepository": "airbyte/source-google-ads",
5-
"dockerImageTag": "0.1.6",
5+
"dockerImageTag": "0.1.7",
66
"documentationUrl": "https://docs.airbyte.io/integrations/sources/google-ads"
77
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
- sourceDefinitionId: 253487c0-2246-43ba-a21f-5116b20a2c50
2929
name: Google Ads
3030
dockerRepository: airbyte/source-google-ads
31-
dockerImageTag: 0.1.6
31+
dockerImageTag: 0.1.7
3232
documentationUrl: https://docs.airbyte.io/integrations/sources/google-ads
3333
- sourceDefinitionId: fdc8b827-3257-4b33-83cc-106d234c34d4
3434
name: Google Adwords (Deprecated)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ RUN pip install .
1313

1414
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1515

16-
LABEL io.airbyte.version=0.1.6
16+
LABEL io.airbyte.version=0.1.7
1717
LABEL io.airbyte.name=airbyte/source-google-ads

airbyte-integrations/connectors/source-google-ads/source_google_ads/source.py

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
from .google_ads import GoogleAds
3535
from .streams import (
36-
UserLocationReport,
3736
AccountPerformanceReport,
3837
Accounts,
3938
AdGroupAdReport,

airbyte-integrations/connectors/source-google-ads/source_google_ads/streams.py

+1
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class ShoppingPerformanceReport(IncrementalGoogleAdsStream):
193193
Google Ads API field mapping: https://developers.google.com/google-ads/api/docs/migration/mapping#shopping_performance
194194
"""
195195

196+
196197
class UserLocationReport(IncrementalGoogleAdsStream):
197198
"""
198199
UserLocationReport stream: https://developers.google.com/google-ads/api/fields/v8/user_location_view

airbyte-integrations/connectors/source-google-ads/unit_tests/test_google_ads.py

+19
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
from datetime import date
2626
import pendulum
2727

28+
import pendulum
2829
from source_google_ads.google_ads import GoogleAds
30+
from source_google_ads.streams import IncrementalGoogleAdsStream, chunk_date_range
2931

3032
from source_google_ads.streams import chunk_date_range
3133
from source_google_ads.streams import IncrementalGoogleAdsStream
@@ -132,6 +134,23 @@ def test_get_date_params():
132134

133135
assert mock_start_date == start_date and mock_end_date == end_date
134136

137+
def test_interval_chunking():
138+
mock_intervals = [{"segments.date": "2021-05-18"}, {"segments.date": "2021-06-18"}, {"segments.date": "2021-07-18"}]
139+
intervals = chunk_date_range("2021-06-01", 14, "segments.date", "2021-08-15")
140+
141+
assert mock_intervals == intervals
142+
143+
144+
def test_get_date_params():
145+
mock_start_date = "2021-05-19" # Please note that this is equal to inputted stream_slice start date + 1 day
146+
mock_end_date = "2021-06-18"
147+
start_date, end_date = IncrementalGoogleAdsStream.get_date_params(
148+
stream_slice={"segments.date": "2021-05-18"}, cursor_field="segments.date", end_date=pendulum.parse("2021-08-15")
149+
)
150+
151+
assert mock_start_date == start_date and mock_end_date == end_date
152+
153+
135154
def test_convert_schema_into_query():
136155
report_name = "ad_group_ad_report"
137156
query = "SELECT segment.date FROM ad_group_ad WHERE segments.date >= '2020-01-01' AND segments.date <= '2020-03-01' ORDER BY segments.date ASC"

docs/integrations/sources/google-ads.md

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ The Google Ads Query Language can query the Google Ads API. Check out [Google Ad
8787

8888
| Version | Date | Pull Request | Subject |
8989
| :------ | :-------- | :----- | :------ |
90+
| `0.1.7` | 2021-08-03 | [#5422](https://github.com/airbytehq/airbyte/pull/5422) | Correct query to not skip dates |
9091
| `0.1.6` | 2021-08-03 | [#5423](https://github.com/airbytehq/airbyte/pull/5423) | Added new stream UserLocationReport |
9192
| `0.1.5` | 2021-08-03 | [#5159](https://github.com/airbytehq/airbyte/pull/5159) | Add field `login_customer_id` to spec |
9293
| `0.1.4` | 2021-07-28 | [#4962](https://github.com/airbytehq/airbyte/pull/4962) | Support new Report streams |

0 commit comments

Comments
 (0)