Skip to content

Commit e857ff3

Browse files
iSINUStolik0
authored andcommitted
🚨🚨 Source Facebook Marketing: Add statuses filters (airbytehq#32449)
Co-authored-by: Anatolii Yatsuk <[email protected]>
1 parent bd416e2 commit e857ff3

31 files changed

+1507
-436
lines changed

airbyte-integrations/connectors/source-facebook-marketing/integration_tests/conftest.py

+35-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,41 @@ def config_with_wrong_account_fixture(config):
2828

2929

3030
@pytest.fixture(scope="session", name="config_with_include_deleted")
31-
def config_with_include_deleted_fixture(config):
32-
new_config = {**config, "include_deleted": True}
31+
def config_with_include_deleted(config):
32+
new_config = {
33+
**config,
34+
"campaign_statuses": [
35+
"ACTIVE",
36+
"ARCHIVED",
37+
"DELETED",
38+
"IN_PROCESS",
39+
"PAUSED",
40+
"WITH_ISSUES",
41+
],
42+
"adset_statuses": [
43+
"ACTIVE",
44+
"ARCHIVED",
45+
"CAMPAIGN_PAUSED",
46+
"DELETED",
47+
"IN_PROCESS",
48+
"PAUSED",
49+
"WITH_ISSUES",
50+
],
51+
"ad_statuses": [
52+
"ACTIVE",
53+
"ADSET_PAUSED",
54+
"ARCHIVED",
55+
"CAMPAIGN_PAUSED",
56+
"DELETED",
57+
"DISAPPROVED",
58+
"IN_PROCESS",
59+
"PAUSED",
60+
"PENDING_BILLING_INFO",
61+
"PENDING_REVIEW",
62+
"PREAPPROVED",
63+
"WITH_ISSUES",
64+
],
65+
}
3366
new_config.pop("_limit", None)
3467
new_config.pop("end_date", None)
3568
return new_config

airbyte-integrations/connectors/source-facebook-marketing/integration_tests/expected_records.jsonl

+25-25
Large diffs are not rendered by default.

airbyte-integrations/connectors/source-facebook-marketing/integration_tests/future_state.json

+29-30
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"stream": {
55
"stream_state": {
66
"event_time": "2121-07-25T13:34:26Z",
7-
"include_deleted": true
7+
"filter_statuses": []
88
},
99
"stream_descriptor": {
1010
"name": "activities"
@@ -16,7 +16,7 @@
1616
"stream": {
1717
"stream_state": {
1818
"updated_time": "2121-07-25T13:34:26Z",
19-
"include_deleted": true
19+
"filter_statuses": ["ARCHIVED"]
2020
},
2121
"stream_descriptor": {
2222
"name": "campaigns"
@@ -28,7 +28,7 @@
2828
"stream": {
2929
"stream_state": {
3030
"updated_time": "2121-07-25T13:34:26Z",
31-
"include_deleted": true
31+
"filter_statuses": []
3232
},
3333
"stream_descriptor": {
3434
"name": "images"
@@ -40,7 +40,7 @@
4040
"stream": {
4141
"stream_state": {
4242
"updated_time": "2121-07-25T13:34:26Z",
43-
"include_deleted": true
43+
"filter_statuses": []
4444
},
4545
"stream_descriptor": {
4646
"name": "videos"
@@ -52,7 +52,7 @@
5252
"stream": {
5353
"stream_state": {
5454
"updated_time": "2121-07-25T13:34:26Z",
55-
"include_deleted": true
55+
"filter_statuses": []
5656
},
5757
"stream_descriptor": {
5858
"name": "ad_creatives"
@@ -64,7 +64,7 @@
6464
"stream": {
6565
"stream_state": {
6666
"updated_time": "2121-07-25T13:34:26Z",
67-
"include_deleted": true
67+
"filter_statuses": ["ARCHIVED"]
6868
},
6969
"stream_descriptor": {
7070
"name": "ad_sets"
@@ -76,7 +76,7 @@
7676
"stream": {
7777
"stream_state": {
7878
"updated_time": "2121-07-25T13:34:26Z",
79-
"include_deleted": true
79+
"filter_statuses": ["ARCHIVED"]
8080
},
8181
"stream_descriptor": {
8282
"name": "ads"
@@ -88,7 +88,7 @@
8888
"stream": {
8989
"stream_state": {
9090
"date_start": "2121-07-25T13:34:26Z",
91-
"include_deleted": true
91+
"filter_statuses": []
9292
},
9393
"stream_descriptor": {
9494
"name": "ads_insights"
@@ -100,7 +100,7 @@
100100
"stream": {
101101
"stream_state": {
102102
"date_start": "2121-07-25T13:34:26Z",
103-
"include_deleted": true
103+
"filter_statuses": []
104104
},
105105
"stream_descriptor": {
106106
"name": "ads_insights_age_and_gender"
@@ -112,7 +112,7 @@
112112
"stream": {
113113
"stream_state": {
114114
"date_start": "2121-07-25T13:34:26Z",
115-
"include_deleted": true
115+
"filter_statuses": []
116116
},
117117
"stream_descriptor": {
118118
"name": "ads_insights_country"
@@ -124,7 +124,7 @@
124124
"stream": {
125125
"stream_state": {
126126
"date_start": "2121-07-25T13:34:26Z",
127-
"include_deleted": true
127+
"filter_statuses": []
128128
},
129129
"stream_descriptor": {
130130
"name": "ads_insights_dma"
@@ -136,7 +136,7 @@
136136
"stream": {
137137
"stream_state": {
138138
"date_start": "2121-07-25T13:34:26Z",
139-
"include_deleted": true
139+
"filter_statuses": []
140140
},
141141
"stream_descriptor": {
142142
"name": "ads_insights_platform_and_device"
@@ -148,7 +148,7 @@
148148
"stream": {
149149
"stream_state": {
150150
"date_start": "2121-07-25T13:34:26Z",
151-
"include_deleted": true
151+
"filter_statuses": []
152152
},
153153
"stream_descriptor": {
154154
"name": "ads_insights_region"
@@ -160,7 +160,7 @@
160160
"stream": {
161161
"stream_state": {
162162
"date_start": "2121-07-25T13:34:26Z",
163-
"include_deleted": true
163+
"filter_statuses": []
164164
},
165165
"stream_descriptor": {
166166
"name": "ads_insights_action_type"
@@ -172,20 +172,19 @@
172172
"stream": {
173173
"stream_state": {
174174
"date_start": "2121-07-25T13:34:26Z",
175-
"include_deleted": true
175+
"filter_statuses": []
176176
},
177177
"stream_descriptor": {
178178
"name": "custommy_custom_insights"
179179
}
180180
}
181181
},
182-
183182
{
184183
"type": "STREAM",
185184
"stream": {
186185
"stream_state": {
187186
"date_start": "2121-07-25T13:34:26Z",
188-
"include_deleted": true
187+
"filter_statuses": []
189188
},
190189
"stream_descriptor": {
191190
"name": "ads_insights_action_carousel_card"
@@ -197,7 +196,7 @@
197196
"stream": {
198197
"stream_state": {
199198
"date_start": "2121-07-25T13:34:26Z",
200-
"include_deleted": true
199+
"filter_statuses": []
201200
},
202201
"stream_descriptor": {
203202
"name": "ads_insights_action_conversion_device"
@@ -209,7 +208,7 @@
209208
"stream": {
210209
"stream_state": {
211210
"date_start": "2121-07-25T13:34:26Z",
212-
"include_deleted": true
211+
"filter_statuses": []
213212
},
214213
"stream_descriptor": {
215214
"name": "ads_insights_action_product_id"
@@ -221,7 +220,7 @@
221220
"stream": {
222221
"stream_state": {
223222
"date_start": "2121-07-25T13:34:26Z",
224-
"include_deleted": true
223+
"filter_statuses": []
225224
},
226225
"stream_descriptor": {
227226
"name": "ads_insights_action_reaction"
@@ -233,7 +232,7 @@
233232
"stream": {
234233
"stream_state": {
235234
"date_start": "2121-07-25T13:34:26Z",
236-
"include_deleted": true
235+
"filter_statuses": []
237236
},
238237
"stream_descriptor": {
239238
"name": "ads_insights_action_video_sound"
@@ -245,7 +244,7 @@
245244
"stream": {
246245
"stream_state": {
247246
"date_start": "2121-07-25T13:34:26Z",
248-
"include_deleted": true
247+
"filter_statuses": []
249248
},
250249
"stream_descriptor": {
251250
"name": "ads_insights_action_video_type"
@@ -257,7 +256,7 @@
257256
"stream": {
258257
"stream_state": {
259258
"date_start": "2121-07-25T13:34:26Z",
260-
"include_deleted": true
259+
"filter_statuses": []
261260
},
262261
"stream_descriptor": {
263262
"name": "ads_insights_delivery_device"
@@ -269,7 +268,7 @@
269268
"stream": {
270269
"stream_state": {
271270
"date_start": "2121-07-25T13:34:26Z",
272-
"include_deleted": true
271+
"filter_statuses": []
273272
},
274273
"stream_descriptor": {
275274
"name": "ads_insights_delivery_platform"
@@ -281,7 +280,7 @@
281280
"stream": {
282281
"stream_state": {
283282
"date_start": "2121-07-25T13:34:26Z",
284-
"include_deleted": true
283+
"filter_statuses": []
285284
},
286285
"stream_descriptor": {
287286
"name": "ads_insights_delivery_platform_and_device_platform"
@@ -293,7 +292,7 @@
293292
"stream": {
294293
"stream_state": {
295294
"date_start": "2121-07-25T13:34:26Z",
296-
"include_deleted": true
295+
"filter_statuses": []
297296
},
298297
"stream_descriptor": {
299298
"name": "ads_insights_demographics_age"
@@ -305,7 +304,7 @@
305304
"stream": {
306305
"stream_state": {
307306
"date_start": "2121-07-25T13:34:26Z",
308-
"include_deleted": true
307+
"filter_statuses": []
309308
},
310309
"stream_descriptor": {
311310
"name": "ads_insights_demographics_country"
@@ -317,7 +316,7 @@
317316
"stream": {
318317
"stream_state": {
319318
"date_start": "2121-07-25T13:34:26Z",
320-
"include_deleted": true
319+
"filter_statuses": []
321320
},
322321
"stream_descriptor": {
323322
"name": "ads_insights_demographics_dma_region"
@@ -329,7 +328,7 @@
329328
"stream": {
330329
"stream_state": {
331330
"date_start": "2121-07-25T13:34:26Z",
332-
"include_deleted": true
331+
"filter_statuses": []
333332
},
334333
"stream_descriptor": {
335334
"name": "ads_insights_demographics_gender"
@@ -341,7 +340,7 @@
341340
"stream": {
342341
"stream_state": {
343342
"date_start": "2121-07-25T13:34:26Z",
344-
"include_deleted": true
343+
"filter_statuses": []
345344
},
346345
"stream_descriptor": {
347346
"name": "customcustom_insight_stream"
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"start_date": "2023-04-01T00:00:00Z",
33
"account_id": "account",
4-
"access_token": "wrong_token",
5-
"include_deleted": true
4+
"access_token": "wrong_token"
65
}

0 commit comments

Comments
 (0)