Skip to content

Commit b018769

Browse files
✨ Source Facebook Marketing: Added fields in campaign schema (#8257)
* Updated campaigns.json * Source Facebook Marketing: Added support for multiple Facebook accounts Updated version & changelog Closes #7740 * Executed pre-commit routine * bump connector version Co-authored-by: Marcos Marx <[email protected]>
1 parent a283a63 commit b018769

File tree

7 files changed

+98
-28
lines changed

7 files changed

+98
-28
lines changed

airbyte-config/init/src/main/resources/config/STANDARD_SOURCE_DEFINITION/e7778cfc-e97c-4458-9ecb-b4f2bba8946c.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"sourceDefinitionId": "e7778cfc-e97c-4458-9ecb-b4f2bba8946c",
33
"name": "Facebook Marketing",
44
"dockerRepository": "airbyte/source-facebook-marketing",
5-
"dockerImageTag": "0.2.26",
5+
"dockerImageTag": "0.2.27",
66
"documentationUrl": "https://docs.airbyte.io/integrations/sources/facebook-marketing",
77
"icon": "facebook.svg"
88
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
- name: Facebook Marketing
176176
sourceDefinitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c
177177
dockerRepository: airbyte/source-facebook-marketing
178-
dockerImageTag: 0.2.26
178+
dockerImageTag: 0.2.27
179179
documentationUrl: https://docs.airbyte.io/integrations/sources/facebook-marketing
180180
icon: facebook.svg
181181
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
@@ -1428,7 +1428,7 @@
14281428
supportsNormalization: false
14291429
supportsDBT: false
14301430
supported_destination_sync_modes: []
1431-
- dockerImage: "airbyte/source-facebook-marketing:0.2.26"
1431+
- dockerImage: "airbyte/source-facebook-marketing:0.2.27"
14321432
spec:
14331433
documentationUrl: "https://docs.airbyte.io/integrations/sources/facebook-marketing"
14341434
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.26
15+
LABEL io.airbyte.version=0.2.27
1616
LABEL io.airbyte.name=airbyte/source-facebook-marketing

airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,16 @@ def parse_call_rate_header(headers):
5050
usage_header_business_loaded = json.loads(usage_header_business)
5151
for business_object_id in usage_header_business_loaded:
5252
usage_limits = usage_header_business_loaded.get(business_object_id)[0]
53-
usage = max(usage, usage_limits.get("call_count"), usage_limits.get("total_cputime"), usage_limits.get("total_time"))
54-
pause_interval = max(pause_interval, pendulum.duration(minutes=usage_limits.get("estimated_time_to_regain_access", 0)))
53+
usage = max(
54+
usage,
55+
usage_limits.get("call_count"),
56+
usage_limits.get("total_cputime"),
57+
usage_limits.get("total_time"),
58+
)
59+
pause_interval = max(
60+
pause_interval,
61+
pendulum.duration(minutes=usage_limits.get("estimated_time_to_regain_access", 0)),
62+
)
5563

5664
return usage, pause_interval
5765

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

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,116 @@
11
{
22
"properties": {
3-
"name": {
3+
"account_id": {
44
"type": ["null", "string"]
55
},
6-
"objective": {
7-
"type": ["null", "string"]
6+
"adlabels": {
7+
"type": ["null", "array"],
8+
"items": {
9+
"type": "object",
10+
"properties": {
11+
"id": {
12+
"type": "string"
13+
},
14+
"name": {
15+
"type": "string"
16+
},
17+
"created_time": {
18+
"type": "string",
19+
"format": "date-time"
20+
},
21+
"updated_time": {
22+
"type": "string",
23+
"format": "date-time"
24+
}
25+
}
26+
}
827
},
9-
"id": {
28+
"bid_strategy": {
1029
"type": ["null", "string"]
1130
},
12-
"account_id": {
13-
"type": ["null", "string"]
31+
"budget_rebalance_flag": {
32+
"type": ["null", "boolean"]
1433
},
15-
"effective_status": {
16-
"type": ["null", "string"]
34+
"budget_remaining": {
35+
"type": ["null", "number"]
1736
},
1837
"buying_type": {
1938
"type": ["null", "string"]
2039
},
21-
"spend_cap": {
40+
"daily_budget": {
2241
"type": ["null", "number"]
2342
},
24-
"start_time": {
43+
"created_time": {
2544
"type": "string",
2645
"format": "date-time"
2746
},
28-
"updated_time": {
29-
"type": "string",
30-
"format": "date-time"
47+
"effective_status": {
48+
"type": ["null", "string"]
3149
},
32-
"adlabels": {
50+
"id": {
51+
"type": ["null", "string"]
52+
},
53+
"issues_info": {
3354
"type": ["null", "array"],
3455
"items": {
3556
"type": "object",
3657
"properties": {
37-
"id": {
58+
"error_code": {
3859
"type": "string"
3960
},
40-
"name": {
61+
"error_message": {
4162
"type": "string"
4263
},
43-
"created_time": {
44-
"type": "string",
45-
"format": "date-time"
64+
"error_summary": {
65+
"type": "string"
4666
},
47-
"updated_time": {
48-
"type": "string",
49-
"format": "date-time"
67+
"error_type": {
68+
"type": "string"
69+
},
70+
"level": {
71+
"type": "string"
5072
}
5173
}
5274
}
75+
},
76+
"lifetime_budget": {
77+
"type": ["null", "number"]
78+
},
79+
"name": {
80+
"type": ["null", "string"]
81+
},
82+
"objective": {
83+
"type": ["null", "string"]
84+
},
85+
"smart_promotion_type": {
86+
"type": ["null", "string"]
87+
},
88+
"source_campaign_id": {
89+
"type": ["null", "number"]
90+
},
91+
"special_ad_category": {
92+
"type": ["null", "string"]
93+
},
94+
"special_ad_category_country": {
95+
"type": ["null", "array"],
96+
"items": {
97+
"type": ["null", "string"]
98+
}
99+
},
100+
"spend_cap": {
101+
"type": ["null", "number"]
102+
},
103+
"start_time": {
104+
"type": "string",
105+
"format": "date-time"
106+
},
107+
"stop_time": {
108+
"type": "string",
109+
"format": "date-time"
110+
},
111+
"updated_time": {
112+
"type": "string",
113+
"format": "date-time"
53114
}
54115
},
55116
"type": ["null", "object"]

docs/integrations/sources/facebook-marketing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ As a summary, custom insights allows to replicate only some fields, resulting in
9696

9797
| Version | Date | Pull Request | Subject |
9898
| :--- | :--- | :--- | :--- |
99+
| 0.2.27 | 2021-11-29 | [8257](https://github.com/airbytehq/airbyte/pull/8257) | Add fields to Campaign stream |
99100
| 0.2.26 | 2021-11-19 | [7855](https://github.com/airbytehq/airbyte/pull/7855) | Add Video stream |
100101
| 0.2.25 | 2021-11-12 | [7904](https://github.com/airbytehq/airbyte/pull/7904) | Implement retry logic for async jobs |
101102
| 0.2.24 | 2021-11-09 | [7744](https://github.com/airbytehq/airbyte/pull/7744) | Fix fail when async job takes too long |

0 commit comments

Comments
 (0)