airflow.providers.google.cloud.transfers.gdrive_to_local

GoogleDriveToLocalOperator

将 Google Drive 文件写入本地存储。

模块内容

class airflow.providers.google.cloud.transfers.gdrive_to_local.GoogleDriveToLocalOperator(*, output_file, file_name, folder_id, drive_id=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[源代码]

基础: airflow.models.BaseOperator

将 Google Drive 文件写入本地存储。

另请参阅

有关如何使用此操作符的更多信息,请查看指南:GCSToLocalFilesystemOperator

参数:
  • output_file (str) – 下载文件的路径

  • folder_id (str) – Google Drive 文件所在的文件夹 ID

  • file_name (str) – Google Drive 中的文件名

  • gcp_conn_id (str) – 获取连接信息时使用的 GCP 连接 ID。

  • drive_id (str | None) – 可选。文件所在的共享 Google Drive 的 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] = ('output_file', 'folder_id', 'file_name', 'drive_id', 'impersonation_chain')[源代码]
output_file[源代码]
folder_id[源代码]
drive_id = None[源代码]
file_name[源代码]
gcp_conn_id = 'google_cloud_default'[源代码]
impersonation_chain = None[源代码]
execute(context)[源代码]

创建操作符时派生。

Context 与渲染 Jinja 模板时使用的字典相同。

请参阅 get_template_context 以获取更多上下文信息。

这条内容有帮助吗?