Skip to content

Commit 406b38b

Browse files
authored
Replace default api_version of FacebookAdsReportToGcsOperator (#18996)
1 parent 258451c commit 406b38b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

β€Žairflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class FacebookAdsReportToGcsOperator(BaseOperator):
5353
:type gcp_conn_id: str
5454
:param facebook_conn_id: Airflow Facebook Ads connection ID
5555
:type facebook_conn_id: str
56-
:param api_version: The version of Facebook API. Default to v6.0
56+
:param api_version: The version of Facebook API. Default to None. If it is None,
57+
it will use the Facebook business SDK default version.
5758
:type api_version: str
5859
:param fields: List of fields that is obtained from Facebook. Found in AdsInsights.Field class.
5960
https://developers.facebook.com/docs/marketing-api/insights/parameters/v6.0
@@ -95,7 +96,7 @@ def __init__(
9596
params: Dict[str, Any] = None,
9697
parameters: Dict[str, Any] = None,
9798
gzip: bool = False,
98-
api_version: str = "v6.0",
99+
api_version: Optional[str] = None,
99100
gcp_conn_id: str = "google_cloud_default",
100101
facebook_conn_id: str = "facebook_default",
101102
impersonation_chain: Optional[Union[str, Sequence[str]]] = None,

β€Žtests/providers/google/cloud/transfers/test_facebook_ads_to_gcs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
GCS_CONN_ID = "google_cloud_default"
2424
IMPERSONATION_CHAIN = ["ACCOUNT_1", "ACCOUNT_2", "ACCOUNT_3"]
2525
FACEBOOK_ADS_CONN_ID = "facebook_default"
26-
API_VERSION = "v6.0"
2726
FIELDS = [
2827
"campaign_name",
2928
"campaign_id",
@@ -58,7 +57,7 @@ def test_execute(self, mock_gcs_hook, mock_ads_hook):
5857
impersonation_chain=IMPERSONATION_CHAIN,
5958
)
6059
op.execute({})
61-
mock_ads_hook.assert_called_once_with(facebook_conn_id=FACEBOOK_ADS_CONN_ID, api_version=API_VERSION)
60+
mock_ads_hook.assert_called_once_with(facebook_conn_id=FACEBOOK_ADS_CONN_ID, api_version=None)
6261
mock_ads_hook.return_value.bulk_facebook_report.assert_called_once_with(
6362
params=PARAMETERS, fields=FIELDS
6463
)

0 commit comments

Comments
 (0)