Skip to content
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
19 changes: 19 additions & 0 deletions gcloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from gcloud.client import JSONClient
from gcloud.bigquery.connection import Connection
from gcloud.bigquery.dataset import Dataset
from gcloud.bigquery.job import LoadTableFromStorageJob


class Client(JSONClient):
Expand Down Expand Up @@ -96,3 +97,21 @@ def dataset(self, name):
:returns: a new ``Dataset`` instance
"""
return Dataset(name, client=self)

def load_table_from_storage(self, name, destination, *source_uris):
"""Construct a job for loading data into a table from CloudStorage.

:type name: string
:param 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.

:rtype: :class:`gcloud.bigquery.job.LoadTableFromStorageJob`
:returns: a new ``LoadTableFromStorageJob`` instance
"""
return LoadTableFromStorageJob(name, destination, source_uris,
client=self)
Loading