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
30 changes: 20 additions & 10 deletions bigquery/google/cloud/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@
from pkg_resources import get_distribution
__version__ = get_distribution('google-cloud-bigquery').version

from google.cloud.bigquery._helpers import Row
from google.cloud.bigquery._helpers import DEFAULT_RETRY
from google.cloud.bigquery.client import Client
from google.cloud.bigquery.dataset import AccessEntry
from google.cloud.bigquery.dataset import Dataset
from google.cloud.bigquery.dataset import DatasetReference
from google.cloud.bigquery.job import CopyJob
from google.cloud.bigquery.job import CopyJobConfig
from google.cloud.bigquery.job import ExtractJob
from google.cloud.bigquery.job import ExtractJobConfig
from google.cloud.bigquery.job import QueryJob
from google.cloud.bigquery.job import QueryJobConfig
from google.cloud.bigquery.job import LoadJob
from google.cloud.bigquery.job import LoadJobConfig
from google.cloud.bigquery.query import ArrayQueryParameter
from google.cloud.bigquery.query import ScalarQueryParameter
Expand All @@ -52,27 +55,34 @@

__all__ = [
'__version__',
'AccessEntry',
'ArrayQueryParameter',
'Client',
# Queries
'QueryJob',
'QueryJobConfig',
'ArrayQueryParameter',
'ScalarQueryParameter',
'StructQueryParameter',
# Datasets
'Dataset',
'DatasetReference',
'AccessEntry',
# Tables
'Table',
'TableReference',
'CopyJob',
'CopyJobConfig',
'ExtractJob',
'ExtractJobConfig',
'QueryJobConfig',
'Row',
'LoadJob',
'LoadJobConfig',
'ScalarQueryParameter',
# Shared helpers
'SchemaField',
'StructQueryParameter',
'Table',
'TableReference',
'UDFResource',
'DEFAULT_RETRY',
'ExternalConfig',
'BigtableOptions',
'BigtableColumnFamily',
'BigtableColumn',
'CSVOptions',
'GoogleSheetsOptions',
'DEFAULT_RETRY',
]
2 changes: 1 addition & 1 deletion bigquery/google/cloud/bigquery/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def _item_to_row(iterator, resource):
:type resource: dict
:param resource: An item to be converted to a row.

:rtype: :class:`Row`
:rtype: :class:`~google.cloud.bigquery.Row`
:returns: The next row in the page.
"""
return Row(_row_tuple_from_json(resource, iterator.schema),
Expand Down
117 changes: 61 additions & 56 deletions bigquery/google/cloud/bigquery/client.py

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions bigquery/google/cloud/bigquery/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def table(self, table_id):
:type table_id: str
:param table_id: the ID of the table.

:rtype: :class:`google.cloud.bigquery.table.TableReference`
:rtype: :class:`google.cloud.bigquery.TableReference`
:returns: a TableReference for a table in this dataset.
"""
return TableReference(self, table_id)
Expand All @@ -169,7 +169,7 @@ def _key(self):
Used to compute this instance's hashcode and evaluate equality.

Returns:
tuple: The contents of this :class:`DatasetReference`.
tuple: The contents of this :class:`.DatasetReference`.
"""
return (
self._project,
Expand Down Expand Up @@ -197,7 +197,7 @@ class Dataset(object):
See
https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets

:type dataset_ref: :class:`~google.cloud.bigquery.dataset.DatasetReference`
:type dataset_ref: :class:`~google.cloud.bigquery.DatasetReference`
:param dataset_ref: a pointer to a dataset
"""

Expand Down Expand Up @@ -238,7 +238,7 @@ def access_entries(self):
def access_entries(self, value):
"""Update dataset's access entries

:type value: list of :class:`AccessEntry`
:type value: list of :class:`~google.cloud.bigquery.AccessEntry`
:param value: roles granted to entities for this dataset

:raises: TypeError if 'value' is not a sequence, or ValueError if
Expand Down Expand Up @@ -429,7 +429,7 @@ def from_api_repr(cls, resource):
:type resource: dict
:param resource: dataset resource representation returned from the API

:rtype: :class:`google.cloud.bigquery.dataset.Dataset`
:rtype: :class:`~google.cloud.bigquery.Dataset`
:returns: Dataset parsed from ``resource``.
"""
dsr = resource.get('datasetReference')
Expand All @@ -451,7 +451,7 @@ def _parse_access_entries(access):
:type access: list of mappings
:param access: each mapping represents a single access entry.

:rtype: list of :class:`AccessEntry`
:rtype: list of :class:`~google.cloud.bigquery.AccessEntry`
:returns: a list of parsed entries.
:raises: :class:`ValueError` if a entry in ``access`` has more keys
than ``role`` and one additional key.
Expand Down Expand Up @@ -530,7 +530,7 @@ def table(self, table_id):
:type table_id: str
:param table_id: the ID of the table.

:rtype: :class:`google.cloud.bigquery.table.TableReference`
:rtype: :class:`~google.cloud.bigquery.TableReference`
:returns: a TableReference for a table in this dataset.
"""
return TableReference(self, table_id)
5 changes: 0 additions & 5 deletions bigquery/google/cloud/bigquery/dbapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

.. _Python Database API Specification v2.0 (DB-API):
https://www.python.org/dev/peps/pep-0249/

.. warning::
The ``dbapi`` module is **alpha**. The implementation is not complete. It
might be changed in backward-incompatible ways and is not subject to any SLA
or deprecation policy.
"""

from google.cloud.bigquery.dbapi.connection import connect
Expand Down
12 changes: 6 additions & 6 deletions bigquery/google/cloud/bigquery/external_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def from_api_repr(cls, resource):
:param resource:
A column in the same representation as is returned from the API.

:rtype: :class:`google.cloud.bigquery.external_config.BigtableColumn`
:rtype: :class:`~google.cloud.bigquery.BigtableColumn`
:returns: Configuration parsed from ``resource``.
"""
config = cls()
Expand Down Expand Up @@ -177,7 +177,7 @@ def from_api_repr(cls, resource):
from the API.

:rtype:
:class:`google.cloud.bigquery.external_config.BigtableColumnFamily`
:class:`~google.cloud.bigquery.BigtableColumnFamily`
:returns: Configuration parsed from ``resource``.
"""
config = cls()
Expand Down Expand Up @@ -239,7 +239,7 @@ def from_api_repr(cls, resource):
A BigtableOptions in the same representation as is returned
from the API.

:rtype: :class:`google.cloud.bigquery.external_config.BigtableOptions`
:rtype: :class:`~google.cloud.bigquery.BigtableOptions`
:returns: Configuration parsed from ``resource``.
"""
config = cls()
Expand Down Expand Up @@ -321,7 +321,7 @@ def from_api_repr(cls, resource):
A CSVOptions in the same representation as is
returned from the API.

:rtype: :class:`google.cloud.bigquery.external_config.CSVOptions`
:rtype: :class:`~google.cloud.bigquery.CSVOptions`
:returns: Configuration parsed from ``resource``.
"""
slr = resource.get('skipLeadingRows')
Expand Down Expand Up @@ -369,7 +369,7 @@ def from_api_repr(cls, resource):
returned from the API.

:rtype:
:class:`google.cloud.bigquery.external_config.GoogleSheetsOptions`
:class:`~google.cloud.bigquery.GoogleSheetsOptions`
:returns: Configuration parsed from ``resource``.
"""
slr = resource.get('skipLeadingRows')
Expand Down Expand Up @@ -476,7 +476,7 @@ def from_api_repr(cls, resource):
An extract job configuration in the same representation as is
returned from the API.

:rtype: :class:`google.cloud.bigquery.external_config.CSVOptions`
:rtype: :class:`~google.cloud.bigquery.CSVOptions`
:returns: Configuration parsed from ``resource``.
"""
config = cls(resource['sourceFormat'])
Expand Down
Loading