blob: 979a805a008189828acb1aef2bf779053217deb6 [file] [log] [blame]
:py:mod:`airflow.providers.google.cloud.transfers.bigquery_to_gcs`
==================================================================
.. py:module:: airflow.providers.google.cloud.transfers.bigquery_to_gcs
.. autoapi-nested-parse::
This module contains Google BigQuery to Google Cloud Storage operator.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.google.cloud.transfers.bigquery_to_gcs.BigQueryToGCSOperator
.. py:class:: BigQueryToGCSOperator(*, source_project_dataset_table, destination_cloud_storage_uris, project_id = None, compression = 'NONE', export_format = 'CSV', field_delimiter = ',', print_header = True, gcp_conn_id = 'google_cloud_default', delegate_to = None, labels = None, location = None, impersonation_chain = None, result_retry = DEFAULT_RETRY, result_timeout = None, job_id = None, force_rerun = False, reattach_states = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Transfers a BigQuery table to a Google Cloud Storage bucket.
.. seealso::
For more details about these parameters:
https://cloud.google.com/bigquery/docs/reference/v2/jobs
:param source_project_dataset_table: The dotted
``(<project>.|<project>:)<dataset>.<table>`` BigQuery table to use as the
source data. If ``<project>`` is not included, project will be the project
defined in the connection json. (templated)
:param destination_cloud_storage_uris: The destination Google Cloud
Storage URI (e.g. gs://some-bucket/some-file.txt). (templated) Follows
convention defined here:
https://cloud.google.com/bigquery/exporting-data-from-bigquery#exportingmultiple
:param project_id: Google Cloud Project where the job is running
:param compression: Type of compression to use.
:param export_format: File format to export.
:param field_delimiter: The delimiter to use when extracting to a CSV.
:param print_header: Whether to print a header for a CSV file extract.
: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 labels: a dictionary containing labels for the job/query,
passed to BigQuery
:param location: The location used for the operation.
: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 result_retry: How to retry the `result` call that retrieves rows
:param result_timeout: The number of seconds to wait for `result` method before using `result_retry`
:param job_id: The ID of the job. It will be suffixed with hash of job configuration
unless ``force_rerun`` is True.
The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or
dashes (-). The maximum length is 1,024 characters. If not provided then uuid will
be generated.
:param force_rerun: If True then operator will use hash of uuid as job id suffix
:param reattach_states: Set of BigQuery job's states in case of which we should reattach
to the job. Should be other than final states.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['source_project_dataset_table', 'destination_cloud_storage_uris', 'labels', 'impersonation_chain']
.. py:attribute:: template_ext
:annotation: :Sequence[str] = []
.. py:attribute:: ui_color
:annotation: = #e4e6f0
.. py:attribute:: operator_extra_links
.. 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.