From 925471b0e1ed758feec8aecad724b0a0c81f294a Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Wed, 13 Sep 2017 18:00:53 -0400 Subject: [PATCH] bigquery: rename TableReference.dataset_ref (#3953) * bigquery: rename TableReference.dataset_ref Rename to dataset to be consistent with Client.dataset. Both methods actually return a DatasetReference. * fix broken tests --- bigquery/google/cloud/bigquery/table.py | 2 +- bigquery/tests/unit/test_dataset.py | 2 +- bigquery/tests/unit/test_table.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bigquery/google/cloud/bigquery/table.py b/bigquery/google/cloud/bigquery/table.py index 3a66db152faa..84d3baa31068 100644 --- a/bigquery/google/cloud/bigquery/table.py +++ b/bigquery/google/cloud/bigquery/table.py @@ -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` diff --git a/bigquery/tests/unit/test_dataset.py b/bigquery/tests/unit/test_dataset.py index c509be6838a1..09fdbbe034ce 100644 --- a/bigquery/tests/unit/test_dataset.py +++ b/bigquery/tests/unit/test_dataset.py @@ -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') diff --git a/bigquery/tests/unit/test_table.py b/bigquery/tests/unit/test_table.py index 2629f824e0b2..9e0db94bc6cb 100644 --- a/bigquery/tests/unit/test_table.py +++ b/bigquery/tests/unit/test_table.py @@ -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')