Google Sheets 至 Google Cloud Storage 傳輸運算子

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

透過 Google Sheets,所有人都可以同時在同一個試算表中協同作業。使用公式、函數和格式設定選項來節省時間並簡化常見的試算表任務。

先決條件任務

若要使用這些運算子,您必須完成幾件事

從 Google Sheets 上傳資料至 GCS

若要從 Google 試算表上傳資料至 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_iddestination_bucketdestination_pathsheet_filterimpersonation_chain 一起使用。

此條目是否對您有幫助?