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
24 changes: 12 additions & 12 deletions gcloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class Client(JSONClient):
"""Client to bundle configuration needed for API requests.

:type project: string
:type project: str
:param project: the project which the client acts on behalf of. Will be
passed when creating a dataset / job. If not passed,
falls back to the default inferred from the environment.
Expand Down Expand Up @@ -62,7 +62,7 @@ def list_datasets(self, include_all=False, max_results=None,
:param max_results: maximum number of datasets to return, If not
passed, defaults to a value set by the API.

:type page_token: string
:type page_token: str
:param page_token: opaque marker for the next "page" of datasets. If
not passed, the API will return the first page of
datasets.
Expand Down Expand Up @@ -94,7 +94,7 @@ def list_datasets(self, include_all=False, max_results=None,
def dataset(self, dataset_name):
"""Construct a dataset bound to this client.

:type dataset_name: string
:type dataset_name: str
:param dataset_name: Name of the dataset.

:rtype: :class:`gcloud.bigquery.dataset.Dataset`
Expand All @@ -108,7 +108,7 @@ def job_from_resource(self, resource):
:type resource: dict
:param resource: one job resource from API response

:rtype; One of:
:rtype: One of:
:class:`gcloud.bigquery.job.LoadTableFromStorageJob`,
:class:`gcloud.bigquery.job.CopyJob`,
:class:`gcloud.bigquery.job.ExtractTableToStorageJob`,
Expand Down Expand Up @@ -138,7 +138,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None,
:param max_results: maximum number of jobs to return, If not
passed, defaults to a value set by the API.

:type page_token: string
:type page_token: str
:param page_token: opaque marker for the next "page" of jobs. If
not passed, the API will return the first page of
jobs.
Expand All @@ -147,7 +147,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None,
:param all_users: if true, include jobs owned by all users in the
project.

:type state_filter: string
:type state_filter: str
:param state_filter: if passed, include only jobs matching the given
state. One of

Expand Down Expand Up @@ -187,7 +187,7 @@ def load_table_from_storage(self, job_name, destination, *source_uris):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.load

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

:type destination: :class:`gcloud.bigquery.table.Table`
Expand All @@ -209,7 +209,7 @@ def copy_table(self, job_name, destination, *sources):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy

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

:type destination: :class:`gcloud.bigquery.table.Table`
Expand All @@ -229,7 +229,7 @@ def extract_table_to_storage(self, job_name, source, *destination_uris):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.extract

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

:type source: :class:`gcloud.bigquery.table.Table`
Expand All @@ -252,10 +252,10 @@ def run_async_query(self, job_name, query):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.query

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

:type query: string
:type query: str
:param query: SQL query to be executed

:rtype: :class:`gcloud.bigquery.job.QueryJob`
Expand All @@ -266,7 +266,7 @@ def run_async_query(self, job_name, query):
def run_sync_query(self, query):
"""Run a SQL query synchronously.

:type query: string
:type query: str
:param query: SQL query to be executed

:rtype: :class:`gcloud.bigquery.query.QueryResults`
Expand Down
66 changes: 33 additions & 33 deletions gcloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
class SchemaField(object):
"""Describe a single field within a table schema.

:type name: string
:type name: str
:param name: the name of the field

:type field_type: string
:type field_type: str
:param field_type: the type of the field (one of 'STRING', 'INTEGER',
'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD')

:type mode: string
:type mode: str
:param mode: the type of the field (one of 'NULLABLE', 'REQUIRED',
or 'REPEATED')

:type description: string
:type description: str
:param description: optional description for the field

:type fields: list of :class:`SchemaField`, or None
Expand All @@ -69,7 +69,7 @@ class Table(object):
See:
https://cloud.google.com/bigquery/docs/reference/v2/tables

:type name: string
:type name: str
:param name: the name of the table

:type dataset: :class:`gcloud.bigquery.dataset.Dataset`
Expand All @@ -92,7 +92,7 @@ def __init__(self, name, dataset, schema=()):
def project(self):
"""Project bound to the table.

:rtype: string
:rtype: str
:returns: the project (derived from the dataset).
"""
return self._dataset.project
Expand All @@ -101,7 +101,7 @@ def project(self):
def dataset_name(self):
"""Name of dataset containing the table.

:rtype: string
:rtype: str
:returns: the ID (derived from the dataset).
"""
return self._dataset.name
Expand All @@ -110,7 +110,7 @@ def dataset_name(self):
def path(self):
"""URL path for the table's APIs.

:rtype: string
:rtype: str
:returns: the path based on project and dataste name.
"""
return '%s/tables/%s' % (self._dataset.path, self.name)
Expand Down Expand Up @@ -154,7 +154,7 @@ def created(self):
def etag(self):
"""ETag for the table resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ETag (None until set from the server).
"""
return self._properties.get('etag')
Expand Down Expand Up @@ -197,7 +197,7 @@ def num_rows(self):
def self_link(self):
"""URL for the table resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('selfLink')
Expand All @@ -206,7 +206,7 @@ def self_link(self):
def table_id(self):
"""ID for the table resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ID (None until set from the server).
"""
return self._properties.get('id')
Expand All @@ -217,7 +217,7 @@ def table_type(self):

Possible values are "TABLE" or "VIEW".

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('type')
Expand All @@ -226,7 +226,7 @@ def table_type(self):
def description(self):
"""Description of the table.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The description as set by the user, or None (the default).
"""
return self._properties.get('description')
Expand All @@ -235,7 +235,7 @@ def description(self):
def description(self, value):
"""Update description of the table.

:type value: string, or ``NoneType``
:type value: str, or ``NoneType``
:param value: new description

:raises: ValueError for invalid value types.
Expand Down Expand Up @@ -271,7 +271,7 @@ def expires(self, value):
def friendly_name(self):
"""Title of the table.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The name as set by the user, or None (the default).
"""
return self._properties.get('friendlyName')
Expand All @@ -280,7 +280,7 @@ def friendly_name(self):
def friendly_name(self, value):
"""Update title of the table.

:type value: string, or ``NoneType``
:type value: str, or ``NoneType``
:param value: new title

:raises: ValueError for invalid value types.
Expand All @@ -293,7 +293,7 @@ def friendly_name(self, value):
def location(self):
"""Location in which the table is hosted.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The location as set by the user, or None (the default).
"""
return self._properties.get('location')
Expand All @@ -302,7 +302,7 @@ def location(self):
def location(self, value):
"""Update location in which the table is hosted.

:type value: string, or ``NoneType``
:type value: str, or ``NoneType``
:param value: new location

:raises: ValueError for invalid value types.
Expand All @@ -315,7 +315,7 @@ def location(self, value):
def view_query(self):
"""SQL query defining the table as a view.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The query as set by the user, or None (the default).
"""
view = self._properties.get('view')
Expand All @@ -326,7 +326,7 @@ def view_query(self):
def view_query(self, value):
"""Update SQL query defining the table as a view.

:type value: string
:type value: str
:param value: new query

:raises: ValueError for invalid value types.
Expand Down Expand Up @@ -497,19 +497,19 @@ def patch(self,
:param client: the client to use. If not passed, falls back to the
``client`` stored on the current dataset.

:type friendly_name: string or ``NoneType``
:type friendly_name: str or ``NoneType``
:param friendly_name: point in time at which the table expires.

:type description: string or ``NoneType``
:type description: str or ``NoneType``
:param description: point in time at which the table expires.

:type location: string or ``NoneType``
:type location: str or ``NoneType``
:param location: point in time at which the table expires.

:type expires: :class:`datetime.datetime` or ``NoneType``
:param expires: point in time at which the table expires.

:type view_query: string
:type view_query: str
:param view_query: SQL query defining the table as a view

:type schema: list of :class:`SchemaField`
Expand Down Expand Up @@ -598,7 +598,7 @@ def fetch_data(self, max_results=None, page_token=None, client=None):
:type max_results: integer or ``NoneType``
:param max_results: maximum number of rows to return.

:type page_token: string or ``NoneType``
:type page_token: str or ``NoneType``
:param page_token: token representing a cursor into the table's rows.

:type client: :class:`gcloud.bigquery.client.Client` or ``NoneType``
Expand Down Expand Up @@ -658,7 +658,7 @@ def insert_data(self,
:type ignore_unknown_values: boolean or ``NoneType``
:param ignore_unknown_values: ignore columns beyond schema?

:type template_suffix: string or ``NoneType``
:type template_suffix: str or ``NoneType``
:param template_suffix: treat ``name`` as a template table and provide
a suffix. BigQuery will create the table
``<name> + <template_suffix>`` based on the
Expand Down Expand Up @@ -743,7 +743,7 @@ def upload_from_file(self, # pylint: disable=R0913,R0914
:type file_obj: file
:param file_obj: A file handle open for reading.

:type source_format: string
:type source_format: str
:param source_format: one of 'CSV' or 'NEWLINE_DELIMITED_JSON'.
job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
Expand All @@ -769,15 +769,15 @@ def upload_from_file(self, # pylint: disable=R0913,R0914
:param allow_quoted_newlines: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

:type create_disposition: string
:type create_disposition: str
:param create_disposition: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

:type encoding: string
:type encoding: str
:param encoding: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

:type field_delimiter: string
:type field_delimiter: str
:param field_delimiter: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

Expand All @@ -789,15 +789,15 @@ def upload_from_file(self, # pylint: disable=R0913,R0914
:param max_bad_records: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

:type quote_character: string
:type quote_character: str
:param quote_character: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

:type skip_leading_rows: integer
:param skip_leading_rows: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

:type write_disposition: string
:type write_disposition: str
:param write_disposition: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`

Expand Down Expand Up @@ -969,7 +969,7 @@ def _build_schema_resource(fields):
:param fields: schema to be dumped

:rtype: mapping
:returns; a mapping describing the schema of the supplied fields.
:returns: a mapping describing the schema of the supplied fields.
"""
infos = []
for field in fields:
Expand Down
Loading