Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document URI format for loading/extracting Cloud Storage objects. #1280

Merged
merged 1 commit into from
Dec 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions gcloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,18 @@ def dataset(self, dataset_name):
def load_table_from_storage(self, job_name, destination, *source_uris):
"""Construct a job for loading data into a table from CloudStorage.

See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load

:type job_name: string
:param job_name: Name of the job.

:type destination: :class:`gcloud.bigquery.table.Table`
:param destination: Table into which data is to be loaded.

:type source_uris: sequence of string
:param source_uris: URIs of data files to be loaded.
:param source_uris: URIs of data files to be loaded; in format
``gs://<bucket_name>/<object_name_or_glob>``.

:rtype: :class:`gcloud.bigquery.job.LoadTableFromStorageJob`
:returns: a new ``LoadTableFromStorageJob`` instance
Expand All @@ -123,6 +127,9 @@ def load_table_from_storage(self, job_name, destination, *source_uris):
def copy_table(self, job_name, destination, *sources):
"""Construct a job for copying one or more tables into another table.

See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy

:type job_name: string
:param job_name: Name of the job.

Expand All @@ -140,6 +147,9 @@ def copy_table(self, job_name, destination, *sources):
def extract_table_to_storage(self, job_name, source, *destination_uris):
"""Construct a job for extracting a table into Cloud Storage files.

See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.extract

:type job_name: string
:param job_name: Name of the job.

Expand All @@ -148,7 +158,8 @@ def extract_table_to_storage(self, job_name, source, *destination_uris):

:type destination_uris: sequence of string
:param destination_uris: URIs of CloudStorage file(s) into which
table data is to be extracted.
table data is to be extracted; in format
``gs://<bucket_name>/<object_name_or_glob>``.

:rtype: :class:`gcloud.bigquery.job.ExtractTableToStorageJob`
:returns: a new ``ExtractTableToStorageJob`` instance
Expand All @@ -159,6 +170,9 @@ def extract_table_to_storage(self, job_name, source, *destination_uris):
def run_async_query(self, job_name, query):
"""Construct a job for running a SQL query asynchronously.

See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query

:type job_name: string
:param job_name: Name of the job.

Expand Down
6 changes: 4 additions & 2 deletions gcloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ class LoadTableFromStorageJob(_AsyncJob):
:param destination: Table into which data is to be loaded.

:type source_uris: sequence of string
:param source_uris: URIs of data files to be loaded.
:param source_uris: URIs of one or more data files to be loaded, in
format ``gs://<bucket_name>/<object_name_or_glob>``.

:type client: :class:`gcloud.bigquery.client.Client`
:param client: A client which holds credentials and project configuration
Expand Down Expand Up @@ -736,7 +737,8 @@ class ExtractTableToStorageJob(_AsyncJob):

:type destination_uris: list of string
:param destination_uris: URIs describing Cloud Storage blobs into which
extracted data will be written.
extracted data will be written, in format
``gs://<bucket_name>/<object_name_or_glob>``.

:type client: :class:`gcloud.bigquery.client.Client`
:param client: A client which holds credentials and project configuration
Expand Down