Skip to content

Commit 70b5501

Browse files
authored
šŸ› Source Snapchat-Marketing: Add the missing spend field for supported *_stats_* streams (#43826)
1 parent ea3a3c0 commit 70b5501

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

ā€Žairbyte-integrations/connectors/source-snapchat-marketing/metadata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data:
88
connectorSubtype: api
99
connectorType: source
1010
definitionId: 200330b2-ea62-4d11-ac6d-cfe3e3f8ab2b
11-
dockerImageTag: 1.2.2
11+
dockerImageTag: 1.2.3
1212
dockerRepository: airbyte/source-snapchat-marketing
1313
githubIssueLabel: source-snapchat-marketing
1414
icon: snapchat.svg

ā€Žairbyte-integrations/connectors/source-snapchat-marketing/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
33
build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
6-
version = "1.2.2"
6+
version = "1.2.3"
77
name = "source-snapchat-marketing"
88
description = "Source implementation for Snapchat Marketing."
99
authors = [ "Airbyte <[email protected]>",]

ā€Žairbyte-integrations/connectors/source-snapchat-marketing/source_snapchat_marketing/manifest.yaml

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.4.0
1+
version: 4.3.2
22

33
type: DeclarativeSource
44

@@ -776,6 +776,8 @@ definitions:
776776
value: "{{ record.get('stats', {}).get('quartile_3') }}"
777777
- path: ["screen_time_millis"]
778778
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
779+
- path: ["spend"]
780+
value: "{{ record.get('stats', {}).get('spend') }}"
779781
- path: ["swipe_up_percent"]
780782
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
781783
- path: ["swipes"]
@@ -989,6 +991,8 @@ definitions:
989991
value: "{{ record.get('stats', {}).get('quartile_3') }}"
990992
- path: ["screen_time_millis"]
991993
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
994+
- path: ["spend"]
995+
value: "{{ record.get('stats', {}).get('spend') }}"
992996
- path: ["swipe_up_percent"]
993997
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
994998
- path: ["swipes"]
@@ -1180,6 +1184,8 @@ definitions:
11801184
value: "{{ record.get('stats', {}).get('quartile_3') }}"
11811185
- path: ["screen_time_millis"]
11821186
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
1187+
- path: ["spend"]
1188+
value: "{{ record.get('stats', {}).get('spend') }}"
11831189
- path: ["swipe_up_percent"]
11841190
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
11851191
- path: ["swipes"]
@@ -1405,6 +1411,8 @@ definitions:
14051411
value: "{{ record.get('stats', {}).get('quartile_3') }}"
14061412
- path: ["screen_time_millis"]
14071413
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
1414+
- path: ["spend"]
1415+
value: "{{ record.get('stats', {}).get('spend') }}"
14081416
- path: ["swipe_up_percent"]
14091417
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
14101418
- path: ["swipes"]
@@ -1618,6 +1626,8 @@ definitions:
16181626
value: "{{ record.get('stats', {}).get('quartile_3') }}"
16191627
- path: ["screen_time_millis"]
16201628
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
1629+
- path: ["spend"]
1630+
value: "{{ record.get('stats', {}).get('spend') }}"
16211631
- path: ["swipe_up_percent"]
16221632
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
16231633
- path: ["swipes"]
@@ -1809,6 +1819,8 @@ definitions:
18091819
value: "{{ record.get('stats', {}).get('quartile_3') }}"
18101820
- path: ["screen_time_millis"]
18111821
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
1822+
- path: ["spend"]
1823+
value: "{{ record.get('stats', {}).get('spend') }}"
18121824
- path: ["swipe_up_percent"]
18131825
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
18141826
- path: ["swipes"]
@@ -2034,6 +2046,8 @@ definitions:
20342046
value: "{{ record.get('stats', {}).get('quartile_3') }}"
20352047
- path: ["screen_time_millis"]
20362048
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
2049+
- path: ["spend"]
2050+
value: "{{ record.get('stats', {}).get('spend') }}"
20372051
- path: ["swipe_up_percent"]
20382052
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
20392053
- path: ["swipes"]
@@ -2247,6 +2261,8 @@ definitions:
22472261
value: "{{ record.get('stats', {}).get('quartile_3') }}"
22482262
- path: ["screen_time_millis"]
22492263
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
2264+
- path: ["spend"]
2265+
value: "{{ record.get('stats', {}).get('spend') }}"
22502266
- path: ["swipe_up_percent"]
22512267
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
22522268
- path: ["swipes"]
@@ -2438,6 +2454,8 @@ definitions:
24382454
value: "{{ record.get('stats', {}).get('quartile_3') }}"
24392455
- path: ["screen_time_millis"]
24402456
value: "{{ record.get('stats', {}).get('screen_time_millis') }}"
2457+
- path: ["spend"]
2458+
value: "{{ record.get('stats', {}).get('spend') }}"
24412459
- path: ["swipe_up_percent"]
24422460
value: "{{ record.get('stats', {}).get('swipe_up_percent') }}"
24432461
- path: ["swipes"]

ā€Žairbyte-integrations/connectors/source-snapchat-marketing/unit_tests/unit_test.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def test_should_retry_403_error(requests_mock):
4444
"GET", "https://adsapi.snapchat.com/v1/me/organizations", [{"status_code": 403, "json": {"organizations": []}}]
4545
)
4646
stream = find_stream("organizations", config_mock)
47-
47+
# make a single retry to save time
48+
stream.retriever.requester.error_handler.max_retries = 1
49+
4850
with pytest.raises(UserDefinedBackoffException):
4951
list(stream.read_records(sync_mode=SyncMode.full_refresh))
5052

@@ -168,6 +170,7 @@ def test_ads(requests_mock):
168170
"stats": {
169171
"impressions": 0,
170172
"swipes": 0,
173+
"spend": 1,
171174
},
172175
"start_time": "2016-09-26T00:00:00.000-07:00",
173176
"end_time": "2022-07-01T07:00:00.000-07:00",
@@ -191,6 +194,7 @@ def test_ads(requests_mock):
191194
"stats": {
192195
"impressions": 0,
193196
"swipes": 0,
197+
"spend": 2,
194198
},
195199
"start_time": "2016-09-26T00:00:00.000-07:00",
196200
"end_time": "2022-07-01T07:00:00.000-07:00",
@@ -242,6 +246,7 @@ def test_ads_stats_lifetime(requests_mock):
242246
"screen_time_millis": None,
243247
"swipe_up_percent": None,
244248
"swipes": 0,
249+
"spend": 1,
245250
"total_installs": None,
246251
"video_views": None,
247252
"video_views_time_based": None,
@@ -320,6 +325,7 @@ def test_ads_stats_lifetime(requests_mock):
320325
"screen_time_millis": None,
321326
"swipe_up_percent": None,
322327
"swipes": 0,
328+
"spend": 2,
323329
"total_installs": None,
324330
"video_views": None,
325331
"video_views_time_based": None,

ā€Ždocs/integrations/sources/snapchat-marketing.md

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ Syncing data with an hourly granularity often generates large data volumes and c
143143

144144
| Version | Date | Pull Request | Subject |
145145
|:--------|:-----------|:---------------------------------------------------------|:-------------------------------------------------------------------------------|
146+
| 1.2.3 | 2024-08-12 | [43826](https://github.com/airbytehq/airbyte/pull/43826) | Fixed the bug with the missing `spend` field to supported `*_stats_*` streams |
146147
| 1.2.2 | 2024-08-10 | [43539](https://github.com/airbytehq/airbyte/pull/43539) | Update dependencies |
147148
| 1.2.1 | 2024-08-03 | [43174](https://github.com/airbytehq/airbyte/pull/43174) | Update dependencies |
148149
| 1.2.0 | 2024-07-31 | [42010](https://github.com/airbytehq/airbyte/pull/42010) | Migrate to CDK v4.1.0 |

0 commit comments

Comments
Ā (0)