Skip to content

Commit a1801d7

Browse files
jake horbanmarcosmarxm
andauthored
✨ Source Facebook Marketing: Add learning_stage_info field to AdSets stream (#50418)
Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com> Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
1 parent 0d867d4 commit a1801d7

File tree

8 files changed

+154
-26
lines changed

8 files changed

+154
-26
lines changed

airbyte-integrations/connectors/source-facebook-marketing/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ data:
1010
connectorSubtype: api
1111
connectorType: source
1212
definitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c
13-
dockerImageTag: 3.3.35
13+
dockerImageTag: 3.4.0
1414
dockerRepository: airbyte/source-facebook-marketing
1515
documentationUrl: https://docs.airbyte.com/integrations/sources/facebook-marketing
1616
githubIssueLabel: source-facebook-marketing

airbyte-integrations/connectors/source-facebook-marketing/poetry.lock

Lines changed: 112 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml

Lines changed: 1 addition & 1 deletion
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 = "3.3.35"
6+
version = "3.4.0"
77
name = "source-facebook-marketing"
88
description = "Source implementation for Facebook Marketing."
99
authors = [ "Airbyte <contact@airbyte.io>",]

airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/schemas/ad_sets.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,32 @@
161161
}
162162
}
163163
}
164+
},
165+
"learning_stage_info": {
166+
"description": "Info about whether the ranking or delivery system is still learning for this ad set.",
167+
"type": ["null", "object"],
168+
"properties": {
169+
"status": {
170+
"description": "Learning Phase progress for the ad set. Values: LEARNING — The ad set is still learning. SUCCESS — The ad set exited the learning phase. FAIL — The ad set isn’t generating enough results to exit the learning phase.",
171+
"type": ["null", "string"]
172+
},
173+
"conversions": {
174+
"description": "Number of conversions the ad set generated since the time of its last significant edit during the learning phase. Significant edits cause ad sets to reenter the learning phase.",
175+
"type": ["null", "integer"]
176+
},
177+
"last_sig_edit_ts": {
178+
"description": "Timestamp of the last significant edit that caused ad set to reenter the learning phase.",
179+
"type": ["null", "integer"]
180+
},
181+
"attribution_windows": {
182+
"description": "List of configured attribution windows.",
183+
"type": ["null", "array"],
184+
"items": {
185+
"description": "Number of days between when a person viewed or clicked your ad and subsequently took action. By default, the attribution window is set to 1-day view and 28-day click.",
186+
"type": ["null", "string"]
187+
}
188+
}
189+
}
164190
}
165191
}
166192
}

airbyte-integrations/connectors/source-facebook-marketing/unit_tests/integration/test_include_deleted.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def test_ad_sets_stream(self, http_mocker: HttpMocker):
175175
"bid_amount",
176176
"bid_constraints",
177177
"adlabels",
178+
"learning_stage_info",
178179
]
179180

180181
http_mocker.get(

airbyte-integrations/connectors/source-facebook-marketing/unit_tests/resource/http/response/ad_sets.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@
3434
"REACH": 99
3535
},
3636
"bid_strategy": "COST_CAP",
37-
"bid_amount": 99.0
37+
"bid_amount": 99.0,
38+
"learning_stage_info": {
39+
"status": "LEARNING",
40+
"conversions": 12,
41+
"last_sig_edit_ts": 1734947501,
42+
"attribution_windows": ["7d_click", "1d_view"]
43+
}
3844
}
3945
]
4046
}

airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,15 +334,16 @@ def test_get_result_retried(self, mocker, job, api):
334334
api.call().json.return_value = {"data": [{"some_data": 123}, {"some_data": 77}]}
335335
ads_insights = AdsInsights(api=api)
336336
ads_insights._set_data({"items": [{"some_data": 123}, {"some_data": 77}]})
337-
with mocker.patch(
337+
mocker.patch(
338338
"facebook_business.adobjects.objectparser.ObjectParser.parse_multiple",
339339
side_effect=[
340340
FacebookBadObjectError("Bad data to set object data"),
341341
ads_insights,
342342
],
343-
):
344-
# in case this is not retried, an error will be raised
345-
job.get_result()
343+
)
344+
345+
# in case this is not retried, an error will be raised
346+
job.get_result()
346347

347348
def test_get_result_when_job_is_not_started(self, job):
348349
with pytest.raises(

docs/integrations/sources/facebook-marketing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ This response indicates that the Facebook Graph API requires you to reduce the f
269269

270270
| Version | Date | Pull Request | Subject |
271271
|:--------|:-----------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
272+
| 3.4.0 | 2024-12-24 | [50418](https://github.com/airbytehq/airbyte/pull/50418) | Add `learning_stage_info` field to `ad_sets` stream |
272273
| 3.3.35 | 2025-03-08 | [55307](https://github.com/airbytehq/airbyte/pull/55307) | Update dependencies |
273274
| 3.3.34 | 2025-03-01 | [54990](https://github.com/airbytehq/airbyte/pull/54990) | Update dependencies |
274275
| 3.3.33 | 2025-02-22 | [54386](https://github.com/airbytehq/airbyte/pull/54386) | Update dependencies |

0 commit comments

Comments
 (0)