airflow.providers.google.cloud.transfers.sheets_to_gcs

模組內容

類別

GoogleSheetsToGCSOperator

將 Google Sheet 資料寫入 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 Sheet 資料寫入 Google Cloud Storage。

參見

如需更多關於如何使用此運算子的資訊,請參閱指南: 從 Google Sheets 上傳資料至 GCS

參數
  • spreadsheet_id (str) – 要互動的 Google Sheet 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 的鏈式帳戶列表,該帳戶將在請求中被模擬。 如果設定為字串,則該帳戶必須授予原始帳戶「服務帳戶權杖建立者」IAM 角色。 如果設定為序列,則列表中的身分必須將「服務帳戶權杖建立者」IAM 角色授予緊接在前的身分,列表中的第一個帳戶將此角色授予原始帳戶 (樣板化)。

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

在建立運算子時衍生。

Context 是與渲染 Jinja 模板時使用的相同字典。

請參閱 get_template_context 以取得更多上下文。

此條目是否有幫助?