Skip to content

Commit

Permalink
Add docstring to extract method
Browse files Browse the repository at this point in the history
  • Loading branch information
austinweisgrau committed Aug 22, 2024
1 parent c248e20 commit fba4adf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions parsons/google/google_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,22 @@ def extract(
project: Optional[str] = None,
gzip: bool = False,
) -> None:
"""
Extracts a BigQuery table to a Google Cloud Storage bucket.
Args:
dataset (str): The BigQuery dataset containing the table.
table_name (str): The name of the table to extract.
gcs_bucket (str): The GCS bucket where the table will be
exported.
gcs_blob_name (str): The name of the blob in the GCS
bucket.
project (Optional[str]): The Google Cloud project ID. If
not provided, the default project of the client is used.
gzip (bool): If True, the exported file will be compressed
using GZIP. Defaults to False.
"""

dataset_ref = bigquery.DatasetReference(project or self.client.project, dataset)
table_ref = dataset_ref.table(table_name)
gs_destination = f"gs://{gcs_bucket}/{gcs_blob_name}"
Expand Down

0 comments on commit fba4adf

Please sign in to comment.