airflow.providers.google.cloud.transfers.bigquery_to_gcs

This module contains Google BigQuery to Google Cloud Storage operator.

Module Contents

class airflow.providers.google.cloud.transfers.bigquery_to_gcs.BigQueryToGCSOperator(*, source_project_dataset_table: str, destination_cloud_storage_uris: List[str], compression: str = 'NONE', export_format: str = 'CSV', field_delimiter: str = ',', print_header: bool = True, gcp_conn_id: str = 'google_cloud_default', bigquery_conn_id: Optional[str] = None, delegate_to: Optional[str] = None, labels: Optional[Dict] = None, location: Optional[str] = None, impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Transfers a BigQuery table to a Google Cloud Storage bucket.

See also

For more details about these parameters: https://cloud.google.com/bigquery/docs/reference/v2/jobs

Parameters
  • source_project_dataset_table (str) – 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)

  • destination_cloud_storage_uris (List[str]) – 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

  • compression (str) – Type of compression to use.

  • export_format (str) – File format to export.

  • field_delimiter (str) – The delimiter to use when extracting to a CSV.

  • print_header (bool) – Whether to print a header for a CSV file extract.

  • gcp_conn_id (str) – (Optional) The connection ID used to connect to Google Cloud.

  • bigquery_conn_id (str) – (Deprecated) The connection ID used to connect to Google Cloud. This parameter has been deprecated. You should pass the gcp_conn_id parameter instead.

  • delegate_to (str) – 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.

  • labels (dict) – a dictionary containing labels for the job/query, passed to BigQuery

  • location (str) – The location used for the operation.

  • impersonation_chain (Union[str, Sequence[str]]) – 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).

template_fields = ['source_project_dataset_table', 'destination_cloud_storage_uris', 'labels', 'impersonation_chain'][source]
template_ext = [][source]
ui_color = #e4e6f0[source]
execute(self, context)[source]

Was this entry helpful?