airflow.providers.google.ads.transfers.ads_to_gcs

GoogleAdsToGcsOperator

從 Google Ads API 為 1 到 N 個客戶端獲取每日結果。

模組內容

class airflow.providers.google.ads.transfers.ads_to_gcs.GoogleAdsToGcsOperator(*, client_ids, query, attributes, bucket, obj, gcp_conn_id='google_cloud_default', google_ads_conn_id='google_ads_default', gzip=False, impersonation_chain=None, api_version=None, **kwargs)[原始碼]

基類:airflow.models.BaseOperator

從 Google Ads API 為 1 到 N 個客戶端獲取每日結果。

將資料轉換為臨時 CSV 檔案並儲存,然後將 CSV 檔案上傳到 Google Cloud Storage。

另請參閱

有關 Google Ads API 的更多資訊,請查閱 API 文件:https://developers.google.com/google-ads/api/docs/start

另請參閱

有關如何使用此 Operator 的更多資訊,請查閱指南:Google Ads to GCS

引數
  • client_ids (list[str]) – 要查詢的 Google Ads 客戶端 ID 列表

  • query (str) – Google Ads Query Language API 查詢語句

  • attributes (list[str]) – 要提取的 Google Ads 行屬性列表

  • bucket (str) – 要上傳到的 GCS bucket 名稱

  • obj (str) – 儲存物件的 GCS 路徑。必須是完整的檔案路徑(例如 path/to/file.txt

  • gcp_conn_id (str) – Airflow Google Cloud 連線 ID

  • google_ads_conn_id (str) – Airflow Google Ads 連線 ID

  • gzip (bool) – 用於壓縮本地檔案或檔案資料以便上傳的選項

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可選的服務帳號,用於使用短期憑證進行模擬,或者所需帳號的鏈式列表,以獲取列表中最後一個帳號的 access_token,該帳號將在請求中被模擬。如果設定為字串,則該帳號必須授予發起帳號 Service Account Token Creator IAM 角色。如果設定為序列,則列表中的身份必須授予 Service Account Token Creator IAM 角色給直接在其之前的身份,列表中的第一個帳號將此角色授予發起帳號(模板化)。

  • api_version (str | None) – 要使用的可選 Google Ads API 版本。

template_fields: collections.abc.Sequence[str] = ('client_ids', 'query', 'attributes', 'bucket', 'obj', 'impersonation_chain')[原始碼]
client_ids[原始碼]
query[原始碼]
attributes[原始碼]
bucket[原始碼]
obj[原始碼]
gcp_conn_id = 'google_cloud_default'[原始碼]
google_ads_conn_id = 'google_ads_default'[原始碼]
gzip = False[原始碼]
impersonation_chain = None[原始碼]
api_version = None[原始碼]
execute(context)[原始碼]

建立 operator 時進行派生。

上下文與用於渲染 Jinja 模板的字典相同。

更多上下文資訊請參閱 get_template_context。

此條目有幫助嗎?