Skip to content

Commit

Permalink
bigquery: rename TableReference.dataset_ref (#3953)
Browse files Browse the repository at this point in the history
* bigquery: rename TableReference.dataset_ref

Rename to dataset to be consistent with Client.dataset. Both
methods actually return a DatasetReference.

* fix broken tests
  • Loading branch information
jba authored Sep 13, 2017
1 parent 320a49a commit 925471b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bigquery/google/cloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, dataset_ref, table_id):
self._table_id = table_id

@property
def dataset_ref(self):
def dataset(self):
"""Pointer to the dataset.
:rtype: :class:`google.cloud.bigquery.dataset.DatasetReference`
Expand Down
2 changes: 1 addition & 1 deletion bigquery/tests/unit/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_ctor_defaults(self):
def test_table(self):
dataset_ref = self._make_one('some-project-1', 'dataset_1')
table_ref = dataset_ref.table('table_1')
self.assertIs(table_ref.dataset_ref, dataset_ref)
self.assertIs(table_ref.dataset, dataset_ref)
self.assertEqual(table_ref.table_id, 'table_1')


Expand Down
2 changes: 1 addition & 1 deletion bigquery/tests/unit/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_ctor_defaults(self):
dataset_ref = DatasetReference('project_1', 'dataset_1')

table_ref = self._make_one(dataset_ref, 'table_1')
self.assertIs(table_ref.dataset_ref, dataset_ref)
self.assertIs(table_ref.dataset, dataset_ref)
self.assertEqual(table_ref.table_id, 'table_1')


Expand Down

0 comments on commit 925471b

Please sign in to comment.