blob: 2e917a398254703234d825347f9eb55aeb2f27da [file] [log] [blame]
:py:mod:`airflow.providers.google.cloud.transfers.adls_to_gcs`
==============================================================
.. py:module:: airflow.providers.google.cloud.transfers.adls_to_gcs
.. autoapi-nested-parse::
This module contains Azure Data Lake Storage to
Google Cloud Storage operator.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.transfers.adls_to_gcs.ADLSToGCSOperator
.. py:class:: ADLSToGCSOperator(*, src_adls, dest_gcs, azure_data_lake_conn_id, gcp_conn_id = 'google_cloud_default', delegate_to = None, replace = False, gzip = False, google_impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.providers.microsoft.azure.operators.adls.ADLSListOperator`
Synchronizes an Azure Data Lake Storage path with a GCS bucket
:param src_adls: The Azure Data Lake path to find the objects (templated)
:param dest_gcs: The Google Cloud Storage bucket and prefix to
store the objects. (templated)
:param replace: If true, replaces same-named files in GCS
:param gzip: Option to compress file for upload
:param azure_data_lake_conn_id: The connection ID to use when
connecting to Azure Data Lake Storage.
:param gcp_conn_id: (Optional) The connection ID used to connect to Google Cloud.
:param delegate_to: Google 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 google_impersonation_chain: Optional Google 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).
**Examples**:
The following Operator would copy a single file named
``hello/world.avro`` from ADLS to the GCS bucket ``mybucket``. Its full
resulting gcs path will be ``gs://mybucket/hello/world.avro`` ::
copy_single_file = AdlsToGoogleCloudStorageOperator(
task_id='copy_single_file',
src_adls='hello/world.avro',
dest_gcs='gs://mybucket',
replace=False,
azure_data_lake_conn_id='azure_data_lake_default',
gcp_conn_id='google_cloud_default'
)
The following Operator would copy all parquet files from ADLS
to the GCS bucket ``mybucket``. ::
copy_all_files = AdlsToGoogleCloudStorageOperator(
task_id='copy_all_files',
src_adls='*.parquet',
dest_gcs='gs://mybucket',
replace=False,
azure_data_lake_conn_id='azure_data_lake_default',
gcp_conn_id='google_cloud_default'
)
The following Operator would copy all parquet files from ADLS
path ``/hello/world``to the GCS bucket ``mybucket``. ::
copy_world_files = AdlsToGoogleCloudStorageOperator(
task_id='copy_world_files',
src_adls='hello/world/*.parquet',
dest_gcs='gs://mybucket',
replace=False,
azure_data_lake_conn_id='azure_data_lake_default',
gcp_conn_id='google_cloud_default'
)
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['src_adls', 'dest_gcs', 'google_impersonation_chain']
.. py:attribute:: ui_color
:annotation: = #f0eee4
.. py:method:: execute(self, 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.