diff --git a/airbyte-integrations/connectors/source-facebook-marketing/metadata.yaml b/airbyte-integrations/connectors/source-facebook-marketing/metadata.yaml index 3e671b614c5c..24ab2133f78d 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/metadata.yaml +++ b/airbyte-integrations/connectors/source-facebook-marketing/metadata.yaml @@ -10,7 +10,7 @@ data: connectorSubtype: api connectorType: source definitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c - dockerImageTag: 3.3.23 + dockerImageTag: 3.4.0 dockerRepository: airbyte/source-facebook-marketing documentationUrl: https://docs.airbyte.com/integrations/sources/facebook-marketing githubIssueLabel: source-facebook-marketing diff --git a/airbyte-integrations/connectors/source-facebook-marketing/poetry.lock b/airbyte-integrations/connectors/source-facebook-marketing/poetry.lock index e3f0b57dc1b9..f2a41234b57b 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/poetry.lock +++ b/airbyte-integrations/connectors/source-facebook-marketing/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" diff --git a/airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml b/airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml index 0a8bd5317806..535c4f9d0e5a 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml +++ b/airbyte-integrations/connectors/source-facebook-marketing/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] build-backend = "poetry.core.masonry.api" [tool.poetry] -version = "3.3.23" +version = "3.4.0" name = "source-facebook-marketing" description = "Source implementation for Facebook Marketing." authors = [ "Airbyte ",] diff --git a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/schemas/ad_sets.json b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/schemas/ad_sets.json index 49d6feacf161..b7a378801612 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/schemas/ad_sets.json +++ b/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/schemas/ad_sets.json @@ -161,6 +161,32 @@ } } } + }, + "learning_stage_info": { + "description": "Info about whether the ranking or delivery system is still learning for this ad set.", + "type": ["null", "object"], + "properties": { + "status": { + "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.", + "type": ["null", "string"] + }, + "conversions": { + "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.", + "type": ["null", "integer"] + }, + "last_sig_edit_ts": { + "description": "Timestamp of the last significant edit that caused ad set to reenter the learning phase.", + "type": ["null", "integer"] + }, + "attribution_windows": { + "description": "List of configured attribution windows.", + "type": ["null", "array"], + "items": { + "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.", + "type": ["null", "string"] + } + } + } } } } diff --git a/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/integration/test_include_deleted.py b/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/integration/test_include_deleted.py index cd6702add9f1..a6bf4a31fd7f 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/integration/test_include_deleted.py +++ b/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/integration/test_include_deleted.py @@ -175,6 +175,7 @@ def test_ad_sets_stream(self, http_mocker: HttpMocker): "bid_amount", "bid_constraints", "adlabels", + "learning_stage_info", ] http_mocker.get( diff --git a/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/resource/http/response/ad_sets.json b/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/resource/http/response/ad_sets.json index 0aa36e6a0caa..e11e44704a87 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/resource/http/response/ad_sets.json +++ b/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/resource/http/response/ad_sets.json @@ -34,7 +34,13 @@ "REACH": 99 }, "bid_strategy": "COST_CAP", - "bid_amount": 99.0 + "bid_amount": 99.0, + "learning_stage_info": { + "status": "LEARNING", + "conversions": 12, + "last_sig_edit_ts": 1734947501, + "attribution_windows": ["7d_click", "1d_view"] + } } ] } diff --git a/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py b/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py index b174a0500467..70234df3b7ef 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py +++ b/airbyte-integrations/connectors/source-facebook-marketing/unit_tests/test_async_job.py @@ -334,15 +334,16 @@ def test_get_result_retried(self, mocker, job, api): api.call().json.return_value = {"data": [{"some_data": 123}, {"some_data": 77}]} ads_insights = AdsInsights(api=api) ads_insights._set_data({"items": [{"some_data": 123}, {"some_data": 77}]}) - with mocker.patch( + mocker.patch( "facebook_business.adobjects.objectparser.ObjectParser.parse_multiple", side_effect=[ FacebookBadObjectError("Bad data to set object data"), ads_insights, ], - ): - # in case this is not retried, an error will be raised - job.get_result() + ) + + # in case this is not retried, an error will be raised + job.get_result() def test_get_result_when_job_is_not_started(self, job): with pytest.raises( diff --git a/docs/integrations/sources/facebook-marketing.md b/docs/integrations/sources/facebook-marketing.md index 4c99273069c5..04ac2730d04b 100644 --- a/docs/integrations/sources/facebook-marketing.md +++ b/docs/integrations/sources/facebook-marketing.md @@ -269,6 +269,7 @@ This response indicates that the Facebook Graph API requires you to reduce the f | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 3.4.0 | 2024-12-24 | [50418](https://github.com/airbytehq/airbyte/pull/50418) | Add `learning_stage_info` field to `ad_sets` stream | | 3.3.23 | 2024-12-28 | [50533](https://github.com/airbytehq/airbyte/pull/50533) | Update dependencies | | 3.3.22 | 2024-12-21 | [50014](https://github.com/airbytehq/airbyte/pull/50014) | Update dependencies | | 3.3.21 | 2024-12-14 | [49197](https://github.com/airbytehq/airbyte/pull/49197) | Update dependencies |