airflow.contrib.operators.gcs_download_operator

Module Contents

class airflow.contrib.operators.gcs_download_operator.GoogleCloudStorageDownloadOperator(bucket, object, filename=None, store_to_xcom_key=None, google_cloud_storage_conn_id='google_cloud_default', delegate_to=None, *args, **kwargs)[source]

Bases:airflow.models.BaseOperator

Downloads a file from Google Cloud Storage.

Parameters
  • bucket (str) – The Google cloud storage bucket where the object is. (templated)

  • object (str) – The name of the object to download in the Google cloud storage bucket. (templated)

  • filename (str) – The file path on the local file system (where the operator is being executed) that the file should be downloaded to. (templated) If no filename passed, the downloaded data will not be stored on the local file system.

  • store_to_xcom_key (str) – If this param is set, the operator will push the contents of the downloaded file to XCom with the key set in this parameter. If not set, the downloaded data will not be pushed to XCom. (templated)

  • google_cloud_storage_conn_id (str) – The connection ID to use when connecting to Google cloud storage.

  • delegate_to (str) – The account to impersonate, if any. For this to work, the service account making the request must have domain-wide delegation enabled.

template_fields = ['bucket', 'object', 'filename', 'store_to_xcom_key'][source]
ui_color = #f0eee4[source]
execute(self, context)[source]