Skip to content

Commit

Permalink
Replace default api_version of FacebookAdsReportToGcsOperator (#18996)
Browse files Browse the repository at this point in the history
  • Loading branch information
eladkal committed Oct 15, 2021
1 parent 258451c commit 406b38b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class FacebookAdsReportToGcsOperator(BaseOperator):
:type gcp_conn_id: str
:param facebook_conn_id: Airflow Facebook Ads connection ID
:type facebook_conn_id: str
:param api_version: The version of Facebook API. Default to v6.0
:param api_version: The version of Facebook API. Default to None. If it is None,
it will use the Facebook business SDK default version.
:type api_version: str
:param fields: List of fields that is obtained from Facebook. Found in AdsInsights.Field class.
https://developers.facebook.com/docs/marketing-api/insights/parameters/v6.0
Expand Down Expand Up @@ -95,7 +96,7 @@ def __init__(
params: Dict[str, Any] = None,
parameters: Dict[str, Any] = None,
gzip: bool = False,
api_version: str = "v6.0",
api_version: Optional[str] = None,
gcp_conn_id: str = "google_cloud_default",
facebook_conn_id: str = "facebook_default",
impersonation_chain: Optional[Union[str, Sequence[str]]] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
GCS_CONN_ID = "google_cloud_default"
IMPERSONATION_CHAIN = ["ACCOUNT_1", "ACCOUNT_2", "ACCOUNT_3"]
FACEBOOK_ADS_CONN_ID = "facebook_default"
API_VERSION = "v6.0"
FIELDS = [
"campaign_name",
"campaign_id",
Expand Down Expand Up @@ -58,7 +57,7 @@ def test_execute(self, mock_gcs_hook, mock_ads_hook):
impersonation_chain=IMPERSONATION_CHAIN,
)
op.execute({})
mock_ads_hook.assert_called_once_with(facebook_conn_id=FACEBOOK_ADS_CONN_ID, api_version=API_VERSION)
mock_ads_hook.assert_called_once_with(facebook_conn_id=FACEBOOK_ADS_CONN_ID, api_version=None)
mock_ads_hook.return_value.bulk_facebook_report.assert_called_once_with(
params=PARAMETERS, fields=FIELDS
)
Expand Down

0 comments on commit 406b38b

Please sign in to comment.