Skip to content

Commit 66137f6

Browse files
authored
🎉 Source Facebook Marketing: add primary_key for all insights streams (#10138)
* 6557 Add `primary_key` for all insights streams * 6557 Update docs * 6557 Fix integration_tests * 6557 Bump connector's version
1 parent bfe0c9a commit 66137f6

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

‎airbyte-config/init/src/main/resources/seed/source_definitions.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
- name: Facebook Marketing
197197
sourceDefinitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c
198198
dockerRepository: airbyte/source-facebook-marketing
199-
dockerImageTag: 0.2.31
199+
dockerImageTag: 0.2.32
200200
documentationUrl: https://docs.airbyte.io/integrations/sources/facebook-marketing
201201
icon: facebook.svg
202202
sourceType: api

‎airbyte-config/init/src/main/resources/seed/source_specs.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,7 @@
16181618
supportsNormalization: false
16191619
supportsDBT: false
16201620
supported_destination_sync_modes: []
1621-
- dockerImage: "airbyte/source-facebook-marketing:0.2.31"
1621+
- dockerImage: "airbyte/source-facebook-marketing:0.2.32"
16221622
spec:
16231623
documentationUrl: "https://docs.airbyte.io/integrations/sources/facebook-marketing"
16241624
changelogUrl: "https://docs.airbyte.io/integrations/sources/facebook-marketing"

‎airbyte-integrations/connectors/source-facebook-marketing/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ RUN pip install .
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=0.2.31
15+
LABEL io.airbyte.version=0.2.32
1616
LABEL io.airbyte.name=airbyte/source-facebook-marketing

‎airbyte-integrations/connectors/source-facebook-marketing/integration_tests/test_streams.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_streams_with_include_deleted(self, stream_name, deleted_id, config_with
5252
assert deleted_records, f"{stream_name} stream should have deleted records returned"
5353
assert is_specific_deleted_pulled, f"{stream_name} stream should have a deleted record with id={deleted_id}"
5454

55-
@pytest.mark.parametrize("stream_name, deleted_num", [("ads", 2), ("campaigns", 1), ("ad_sets", 1)])
55+
@pytest.mark.parametrize("stream_name, deleted_num", [("ads", 2), ("campaigns", 3), ("ad_sets", 1)])
5656
def test_streams_with_include_deleted_and_state(self, stream_name, deleted_num, config_with_include_deleted, configured_catalog, state):
5757
"""Should ignore state because of include_deleted enabled"""
5858
catalog = self.slice_catalog(configured_catalog, {stream_name})

‎airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/streams.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class AdsInsights(FBMarketingIncrementalStream):
297297
"""doc: https://developers.facebook.com/docs/marketing-api/insights"""
298298

299299
cursor_field = "date_start"
300-
primary_key = None
300+
primary_key = ["account_id", "campaign_id", "adset_id", "ad_id"]
301301

302302
ALL_ACTION_ATTRIBUTION_WINDOWS = [
303303
"1d_click",

‎docs/integrations/sources/facebook-marketing.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
This Source is capable of syncing the following tables and their data:
1313

1414
* [AdSets](https://developers.facebook.com/docs/marketing-api/reference/ad-campaign#fields)
15-
* [Ads](https://developers.facebook.com/docs/marketing-api/reference/adgroup#fields)
15+
* [Ads](https://developers.facebook.com/docs/marketing-api/reference/adgroup#fields)
1616
* [AdCreatives](https://developers.facebook.com/docs/marketing-api/reference/ad-creative#fields)
17-
* [Campaigns](https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group#fields)
18-
* [AdInsights](https://developers.facebook.com/docs/marketing-api/reference/adgroup/insights/)
17+
* [Campaigns](https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group#fields)
18+
* [AdInsights](https://developers.facebook.com/docs/marketing-api/reference/adgroup/insights/)
1919

2020
You can segment the AdInsights table into parts based on the following information. Each part will be synced as a separate table if normalization is enabled:
2121

@@ -31,7 +31,7 @@ For more information, see the [Facebook Insights API documentation. ](https://de
3131

3232
1. Click `Authenticate your Facebook Marketing account`.
3333
2. Enter your Account ID. Learn how to find it are [here](https://www.facebook.com/business/help/1492627900875762).
34-
3. Enter a start date and your Insights settings.
34+
3. Enter a start date and your Insights settings.
3535
4. You're done.
3636

3737
## Getting Started \(Airbyte Open-Source\)
@@ -96,7 +96,8 @@ As a summary, custom insights allows to replicate only some fields, resulting in
9696

9797
| Version | Date | Pull Request | Subject |
9898
| :--- | :--- | :--- | :--- |
99-
| 0.2.31 | 2021-12-28 | [](https://github.com/airbytehq/airbyte/pull/) | Fixed videos stream format field incorrect type |
99+
| 0.2.32 | 2022-01-07 | [10138](https://github.com/airbytehq/airbyte/pull/10138) | Add `primary_key` for all insights streams. |
100+
| 0.2.31 | 2021-12-29 | [9138](https://github.com/airbytehq/airbyte/pull/9138) | Fixed videos stream format field incorrect type |
100101
| 0.2.30 | 2021-12-20 | [8962](https://github.com/airbytehq/airbyte/pull/8962) | Added `asset_feed_spec` field to `ad creatives` stream |
101102
| 0.2.29 | 2021-12-17 | [8649](https://github.com/airbytehq/airbyte/pull/8649) | Retrive ad_creatives image as data encoded |
102103
| 0.2.28 | 2021-12-13 | [8742](https://github.com/airbytehq/airbyte/pull/8742) | Fix for schema generation related to "breakdown" fields |

0 commit comments

Comments
 (0)