Skip to content

Commit

Permalink
✨ Source Facebook Marketing: Added fields in campaign schema (#8257)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
mlavoie-sm360 and marcosmarxm authored Dec 16, 2021
1 parent a283a63 commit b018769
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"sourceDefinitionId": "e7778cfc-e97c-4458-9ecb-b4f2bba8946c",
"name": "Facebook Marketing",
"dockerRepository": "airbyte/source-facebook-marketing",
"dockerImageTag": "0.2.26",
"dockerImageTag": "0.2.27",
"documentationUrl": "https://docs.airbyte.io/integrations/sources/facebook-marketing",
"icon": "facebook.svg"
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
- name: Facebook Marketing
sourceDefinitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c
dockerRepository: airbyte/source-facebook-marketing
dockerImageTag: 0.2.26
dockerImageTag: 0.2.27
documentationUrl: https://docs.airbyte.io/integrations/sources/facebook-marketing
icon: facebook.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-facebook-marketing:0.2.26"
- dockerImage: "airbyte/source-facebook-marketing:0.2.27"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/facebook-marketing"
changelogUrl: "https://docs.airbyte.io/integrations/sources/facebook-marketing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.26
LABEL io.airbyte.version=0.2.27
LABEL io.airbyte.name=airbyte/source-facebook-marketing
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ def parse_call_rate_header(headers):
usage_header_business_loaded = json.loads(usage_header_business)
for business_object_id in usage_header_business_loaded:
usage_limits = usage_header_business_loaded.get(business_object_id)[0]
usage = max(usage, usage_limits.get("call_count"), usage_limits.get("total_cputime"), usage_limits.get("total_time"))
pause_interval = max(pause_interval, pendulum.duration(minutes=usage_limits.get("estimated_time_to_regain_access", 0)))
usage = max(
usage,
usage_limits.get("call_count"),
usage_limits.get("total_cputime"),
usage_limits.get("total_time"),
)
pause_interval = max(
pause_interval,
pendulum.duration(minutes=usage_limits.get("estimated_time_to_regain_access", 0)),
)

return usage, pause_interval

Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,116 @@
{
"properties": {
"name": {
"account_id": {
"type": ["null", "string"]
},
"objective": {
"type": ["null", "string"]
"adlabels": {
"type": ["null", "array"],
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"created_time": {
"type": "string",
"format": "date-time"
},
"updated_time": {
"type": "string",
"format": "date-time"
}
}
}
},
"id": {
"bid_strategy": {
"type": ["null", "string"]
},
"account_id": {
"type": ["null", "string"]
"budget_rebalance_flag": {
"type": ["null", "boolean"]
},
"effective_status": {
"type": ["null", "string"]
"budget_remaining": {
"type": ["null", "number"]
},
"buying_type": {
"type": ["null", "string"]
},
"spend_cap": {
"daily_budget": {
"type": ["null", "number"]
},
"start_time": {
"created_time": {
"type": "string",
"format": "date-time"
},
"updated_time": {
"type": "string",
"format": "date-time"
"effective_status": {
"type": ["null", "string"]
},
"adlabels": {
"id": {
"type": ["null", "string"]
},
"issues_info": {
"type": ["null", "array"],
"items": {
"type": "object",
"properties": {
"id": {
"error_code": {
"type": "string"
},
"name": {
"error_message": {
"type": "string"
},
"created_time": {
"type": "string",
"format": "date-time"
"error_summary": {
"type": "string"
},
"updated_time": {
"type": "string",
"format": "date-time"
"error_type": {
"type": "string"
},
"level": {
"type": "string"
}
}
}
},
"lifetime_budget": {
"type": ["null", "number"]
},
"name": {
"type": ["null", "string"]
},
"objective": {
"type": ["null", "string"]
},
"smart_promotion_type": {
"type": ["null", "string"]
},
"source_campaign_id": {
"type": ["null", "number"]
},
"special_ad_category": {
"type": ["null", "string"]
},
"special_ad_category_country": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
},
"spend_cap": {
"type": ["null", "number"]
},
"start_time": {
"type": "string",
"format": "date-time"
},
"stop_time": {
"type": "string",
"format": "date-time"
},
"updated_time": {
"type": "string",
"format": "date-time"
}
},
"type": ["null", "object"]
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 @@ -96,6 +96,7 @@ As a summary, custom insights allows to replicate only some fields, resulting in

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

0 comments on commit b018769

Please sign in to comment.