LocalFilesystemToGoogleDriveOperator

Google

Upload a list of files to a Google Drive folder. This operator uploads a list of local files to a Google Drive folder. The local files can be deleted after upload (optional)

View on GitHub

Last Updated: Mar. 21, 2022

Access Instructions

Install the Google provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

local_pathsPython list of local file paths
drive_folderpath of the Drive folder
gcp_conn_idAirflow Connection ID for GCP
deleteshould the local files be deleted after upload?
ignore_if_missingif True, then don’t fail even if all files can’t be uploaded.
chunk_sizeFile will be uploaded in chunks of this many bytes. Only used if resumable=True. Pass in a value of -1 if the file is to be uploaded as a single chunk. Note that Google App Engine has a 5MB limit on request size, so you should never set your chunk size larger than 5MB, or to -1.
resumableTrue if this is a resumable upload. False means upload in a single request.
delegate_toThe account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.
impersonation_chainOptional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account

Documentation

Upload a list of files to a Google Drive folder. This operator uploads a list of local files to a Google Drive folder. The local files can be deleted after upload (optional)

See also

For more information on how to use this operator, take a look at the guide: LocalFilesystemToGoogleDriveOperator

Was this page helpful?