Skip to content

Commit a2efd96

Browse files
authored
BigQuery: use submodule aliases in docstrings. (googleapis#4255)
This allows Sphinx to find the source files for documenting properties/attributes.
1 parent 877ef4e commit a2efd96

9 files changed

Lines changed: 213 additions & 167 deletions

File tree

bigquery/google/cloud/bigquery/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
1717
The main concepts with this API are:
1818
19+
- :class:`~google.cloud.bigquery.client.Client` manages connections to the
20+
BigQuery API. Use the client methods to run jobs (such as a
21+
:class:`~google.cloud.bigquery.job.QueryJob` via
22+
:meth:`~google.cloud.bigquery.client.Client.query`) and manage resources.
23+
1924
- :class:`~google.cloud.bigquery.dataset.Dataset` represents a
2025
collection of tables.
2126

bigquery/google/cloud/bigquery/client.py

Lines changed: 64 additions & 63 deletions
Large diffs are not rendered by default.

bigquery/google/cloud/bigquery/dataset.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def table(self, table_id):
146146
:type table_id: str
147147
:param table_id: the ID of the table.
148148
149-
:rtype: :class:`google.cloud.bigquery.TableReference`
149+
:rtype: :class:`google.cloud.bigquery.table.TableReference`
150150
:returns: a TableReference for a table in this dataset.
151151
"""
152152
return TableReference(self, table_id)
@@ -197,7 +197,7 @@ class Dataset(object):
197197
See
198198
https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets
199199
200-
:type dataset_ref: :class:`~google.cloud.bigquery.DatasetReference`
200+
:type dataset_ref: :class:`~google.cloud.bigquery.dataset.DatasetReference`
201201
:param dataset_ref: a pointer to a dataset
202202
"""
203203

@@ -238,7 +238,8 @@ def access_entries(self):
238238
def access_entries(self, value):
239239
"""Update dataset's access entries
240240
241-
:type value: list of :class:`~google.cloud.bigquery.AccessEntry`
241+
:type value:
242+
list of :class:`~google.cloud.bigquery.dataset.AccessEntry`
242243
:param value: roles granted to entities for this dataset
243244
244245
:raises: TypeError if 'value' is not a sequence, or ValueError if
@@ -401,8 +402,9 @@ def labels(self):
401402
"""Labels for the dataset.
402403
403404
This method always returns a dict. To change a dataset's labels,
404-
modify the dict, then call ``Client.update_dataset``. To delete a
405-
label, set its value to ``None`` before updating.
405+
modify the dict, then call
406+
:meth:`google.cloud.bigquery.client.Client.update_dataset`. To delete
407+
a label, set its value to ``None`` before updating.
406408
407409
:rtype: dict, {str -> str}
408410
:returns: A dict of the the dataset's labels.
@@ -429,7 +431,7 @@ def from_api_repr(cls, resource):
429431
:type resource: dict
430432
:param resource: dataset resource representation returned from the API
431433
432-
:rtype: :class:`~google.cloud.bigquery.Dataset`
434+
:rtype: :class:`~google.cloud.bigquery.dataset.Dataset`
433435
:returns: Dataset parsed from ``resource``.
434436
"""
435437
dsr = resource.get('datasetReference')
@@ -451,7 +453,7 @@ def _parse_access_entries(access):
451453
:type access: list of mappings
452454
:param access: each mapping represents a single access entry.
453455
454-
:rtype: list of :class:`~google.cloud.bigquery.AccessEntry`
456+
:rtype: list of :class:`~google.cloud.bigquery.dataset.AccessEntry`
455457
:returns: a list of parsed entries.
456458
:raises: :class:`ValueError` if a entry in ``access`` has more keys
457459
than ``role`` and one additional key.
@@ -530,7 +532,7 @@ def table(self, table_id):
530532
:type table_id: str
531533
:param table_id: the ID of the table.
532534
533-
:rtype: :class:`~google.cloud.bigquery.TableReference`
535+
:rtype: :class:`~google.cloud.bigquery.table.TableReference`
534536
:returns: a TableReference for a table in this dataset.
535537
"""
536538
return TableReference(self, table_id)

bigquery/google/cloud/bigquery/external_config.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def from_api_repr(cls, resource):
177177
from the API.
178178
179179
:rtype:
180-
:class:`~google.cloud.bigquery.BigtableColumnFamily`
180+
:class:`~google.cloud.bigquery.external_config.BigtableColumnFamily`
181181
:returns: Configuration parsed from ``resource``.
182182
"""
183183
config = cls()
@@ -239,7 +239,8 @@ def from_api_repr(cls, resource):
239239
A BigtableOptions in the same representation as is returned
240240
from the API.
241241
242-
:rtype: :class:`~google.cloud.bigquery.BigtableOptions`
242+
:rtype:
243+
:class:`~google.cloud.bigquery.external_config.BigtableOptions`
243244
:returns: Configuration parsed from ``resource``.
244245
"""
245246
config = cls()
@@ -321,7 +322,7 @@ def from_api_repr(cls, resource):
321322
A CSVOptions in the same representation as is
322323
returned from the API.
323324
324-
:rtype: :class:`~google.cloud.bigquery.CSVOptions`
325+
:rtype: :class:`~google.cloud.bigquery.external_config.CSVOptions`
325326
:returns: Configuration parsed from ``resource``.
326327
"""
327328
slr = resource.get('skipLeadingRows')
@@ -369,7 +370,7 @@ def from_api_repr(cls, resource):
369370
returned from the API.
370371
371372
:rtype:
372-
:class:`~google.cloud.bigquery.GoogleSheetsOptions`
373+
:class:`~google.cloud.bigquery.external_config.GoogleSheetsOptions`
373374
:returns: Configuration parsed from ``resource``.
374375
"""
375376
slr = resource.get('skipLeadingRows')
@@ -476,7 +477,7 @@ def from_api_repr(cls, resource):
476477
An extract job configuration in the same representation as is
477478
returned from the API.
478479
479-
:rtype: :class:`~google.cloud.bigquery.CSVOptions`
480+
:rtype: :class:`~google.cloud.bigquery.external_config.CSVOptions`
480481
:returns: Configuration parsed from ``resource``.
481482
"""
482483
config = cls(resource['sourceFormat'])

0 commit comments

Comments
 (0)