|
24 | 24 | from google.cloud.bigquery.table import TableReference |
25 | 25 |
|
26 | 26 |
|
| 27 | +def _get_table_reference(self, table_id): |
| 28 | + """Constructs a TableReference. |
| 29 | +
|
| 30 | + Args: |
| 31 | + table_id (str): The ID of the table. |
| 32 | +
|
| 33 | + Returns: |
| 34 | + google.cloud.bigquery.table.TableReference: |
| 35 | + A table reference for a table in this dataset. |
| 36 | + """ |
| 37 | + return TableReference(self, table_id) |
| 38 | + |
| 39 | + |
27 | 40 | class AccessEntry(object): |
28 | 41 | """Represents grant of an access role to an entity. |
29 | 42 |
|
@@ -191,17 +204,7 @@ def path(self): |
191 | 204 | """str: URL path for the dataset based on project and dataset ID.""" |
192 | 205 | return "/projects/%s/datasets/%s" % (self.project, self.dataset_id) |
193 | 206 |
|
194 | | - def table(self, table_id): |
195 | | - """Constructs a TableReference. |
196 | | -
|
197 | | - Args: |
198 | | - table_id (str): The ID of the table. |
199 | | -
|
200 | | - Returns: |
201 | | - google.cloud.bigquery.table.TableReference: |
202 | | - A table reference for a table in this dataset. |
203 | | - """ |
204 | | - return TableReference(self, table_id) |
| 207 | + table = _get_table_reference |
205 | 208 |
|
206 | 209 | @classmethod |
207 | 210 | def from_api_repr(cls, resource): |
@@ -578,17 +581,7 @@ def _build_resource(self, filter_fields): |
578 | 581 |
|
579 | 582 | return partial |
580 | 583 |
|
581 | | - def table(self, table_id): |
582 | | - """Constructs a TableReference. |
583 | | -
|
584 | | - Args: |
585 | | - table_id (str): the ID of the table. |
586 | | -
|
587 | | - Returns: |
588 | | - google.cloud.bigquery.table.TableReference: |
589 | | - A TableReference for a table in this dataset. |
590 | | - """ |
591 | | - return TableReference(self.reference, table_id) |
| 584 | + table = _get_table_reference |
592 | 585 |
|
593 | 586 | def __repr__(self): |
594 | 587 | return "Dataset({})".format(repr(self.reference)) |
@@ -668,14 +661,4 @@ def reference(self): |
668 | 661 | """ |
669 | 662 | return DatasetReference(self.project, self.dataset_id) |
670 | 663 |
|
671 | | - def table(self, table_id): |
672 | | - """Constructs a TableReference. |
673 | | -
|
674 | | - Args: |
675 | | - table_id (str): the ID of the table. |
676 | | -
|
677 | | - Returns: |
678 | | - google.cloud.bigquery.table.TableReference: |
679 | | - A TableReference for a table in this dataset. |
680 | | - """ |
681 | | - return TableReference(self.reference, table_id) |
| 664 | + table = _get_table_reference |
0 commit comments