Google Sheets 到 Google Cloud Storage 傳輸 Operators

Google 提供了一項服務 Google Cloud Storage。該服務用於儲存來自各種應用程式的大資料。

藉助 Google Sheets,每個人都可以同時在同一個電子表格中協作。使用公式、函式和格式設定選項,可以節省時間並簡化常見的電子表格任務。

先決條件任務

要使用這些 Operators,您必須完成以下幾項操作

將資料從 Google Sheets 上傳到 GCS

要將資料從 Google Spreadsheet 上傳到 Google Cloud Storage,可以使用 GoogleSheetsToGCSOperator

tests/system/google/cloud/gcs/example_sheets_to_gcs.py

upload_sheet_to_gcs = GoogleSheetsToGCSOperator(
    task_id="upload_sheet_to_gcs",
    destination_bucket=BUCKET_NAME,
    spreadsheet_id="{{ task_instance.xcom_pull(task_ids='create_spreadsheet', key='spreadsheet_id') }}",
    gcp_conn_id=CONNECTION_ID,
)

您可以將 Jinja 模板spreadsheet_id, destination_bucket, destination_path, sheet_filter, impersonation_chain 一起使用。

此條目有幫助嗎?