airbytehq / airbytehq/airbyte

Source Facebook Marketing: add 'monthly' to time_increment for Custom Insights

Đang mở
#74,307 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
autoteam community connectors/source/facebook-marketing team/use
Ngôn ngữ chính
Python
Star
22.1k
Fork
5.3k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

## Problem

The Facebook Marketing API supports several `time_increment` values for Insights queries: integers 1-90 (days), `monthly`, and `all_days`.

The connector's `InsightConfig.time_increment` in `spec.py` currently accepts `"1"`, `"7"`, `"28"`, and `"all_days"` — but `"monthly"` is missing, even though the Facebook API handles it natively.

Monthly aggregation returns data grouped by calendar month with deduplicated unique metrics like reach — which cannot be accurately derived by summing daily values.

## Proposed Fix

Add `"monthly"` as an accepted `Literal` value for `time_increment` in `InsightConfig` in [spec.py](https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-facebook-marketing/source_facebook_marketing/spec.py). No changes needed in the API request logic since Facebook already supports this value.

Additionally, the Airbyte Cloud API schema validates `time_increment` as `integer`, rejecting all string values — including the already-supported `"all_days"`. This should be updated to match the connector's actual spec.

## References

- [Facebook API docs — time_increment](https://developers.facebook.com/docs/marketing-api/insights/parameters/v22.0)
- #14391 — Added `all_days` support (closed/completed)
- #57006 — Cloud API rejects string values for `time_increment` (closed as stale)

---
**Internal Tracking:** https://github.com/airbytehq/oncall/issues/11537

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.