airflow.providers.google.cloud.transfers.sheets_to_gcs

GoogleSheetsToGCSOperator

將 Google 表格資料寫入 Google Cloud Storage。

模組內容

class airflow.providers.google.cloud.transfers.sheets_to_gcs.GoogleSheetsToGCSOperator(*, spreadsheet_id, destination_bucket, sheet_filter=None, destination_path=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[原始碼]

基類: airflow.models.BaseOperator

將 Google 表格資料寫入 Google Cloud Storage。

參見

有關如何使用此運算子的更多資訊,請參閱指南: 將資料從 Google 表格上傳到 GCS

引數
  • spreadsheet_id (str) – 要互動的 Google 表格 ID。

  • sheet_filter (list[str] | None) – 預設為 None,如果提供,應為要拉取的表格標題陣列。

  • destination_bucket (str) – 報告應寫入的目標 Google Cloud Storage 儲存桶。(模板化)

  • destination_path (str | None) – 此運算子建立的物件對應的 Google Cloud Storage URI 陣列。例如:path/to/my/files

  • gcp_conn_id (str) – 獲取連線資訊時使用的連線 ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可選的服務賬號,用於使用短期憑據進行模擬,或者用於獲取列表中最後一個賬號的 access_token 所需的鏈式賬號列表,該賬號將在請求中被模擬。如果設定為字串,則該賬號必須授予原始賬號 Service Account Token Creator IAM 角色。如果設定為序列,則列表中標識必須將 Service Account Token Creator IAM 角色授予緊鄰的前一個標識,列表中第一個賬號將此角色授予原始賬號(模板化)。

template_fields: collections.abc.Sequence[str] = ('spreadsheet_id', 'destination_bucket', 'destination_path', 'sheet_filter', 'impersonation_chain')[原始碼]
gcp_conn_id = 'google_cloud_default'[原始碼]
spreadsheet_id[原始碼]
sheet_filter = None[原始碼]
destination_bucket[原始碼]
destination_path = None[原始碼]
impersonation_chain = None[原始碼]
execute(context)[原始碼]

建立運算子時派生此方法。

Context 是用於渲染 Jinja 模板的同一個字典。

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

此條目有幫助嗎?