Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Source Facebook Marketing: Add learning_stage_info field to AdSets stream #50418

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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 <contact@airbyte.io>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def test_ad_sets_stream(self, http_mocker: HttpMocker):
"bid_amount",
"bid_constraints",
"adlabels",
"learning_stage_info",
]

http_mocker.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/facebook-marketing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Loading