blob: a6fb162145529fbe49fc1581b65788b2e133c154 [file] [log] [blame]
:py:mod:`airflow.providers.google.cloud.transfers.gcs_to_local`
===============================================================
.. py:module:: airflow.providers.google.cloud.transfers.gcs_to_local
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.transfers.gcs_to_local.GCSToLocalFilesystemOperator
.. py:class:: GCSToLocalFilesystemOperator(*, bucket, object_name = None, filename = None, store_to_xcom_key = None, gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None, file_encoding = 'utf-8', **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Downloads a file from Google Cloud Storage.
If a filename is supplied, it writes the file to the specified location, alternatively one can
set the ``store_to_xcom_key`` parameter to True push the file content into xcom. When the file size
exceeds the maximum size for xcom it is recommended to write to a file.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:GCSToLocalFilesystemOperator`
:param bucket: The Google Cloud Storage bucket where the object is.
Must not contain 'gs://' prefix. (templated)
:param object_name: The name of the object to download in the Google cloud
storage bucket. (templated)
:param filename: The file path, including filename, 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.
:param store_to_xcom_key: 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)
:param gcp_conn_id: (Optional) The connection ID used to connect to Google Cloud.
:param delegate_to: The 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.
:param impersonation_chain: Optional 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 (templated).
:param file_encoding: Optional encoding used to decode file_bytes into a serializable
string that is suitable for storing to XCom. (templated).
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['bucket', 'object_name', 'filename', 'store_to_xcom_key', 'impersonation_chain', 'file_encoding']
.. py:attribute:: ui_color
:annotation: = #f0eee4
.. py:method:: execute(context)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.
Refer to get_template_context for more context.