Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: Adds client.get_table() and removes table.reload() #4004

Merged
merged 4 commits into from
Sep 20, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
adds system test for client.get_table()
  • Loading branch information
alixhami committed Sep 19, 2017
commit d7df5591583f91e19911802b9e6b1fc0ce79c4f7
15 changes: 15 additions & 0 deletions bigquery/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@ def test_create_table(self):
self.assertTrue(table.exists())
self.assertEqual(table.table_id, TABLE_NAME)

def test_get_table_w_public_dataset(self):
PUBLIC = 'bigquery-public-data'
DATASET_ID = 'samples'
TABLE_ID = 'shakespeare'
table_ref = DatasetReference(PUBLIC, DATASET_ID).table(TABLE_ID)

table = Config.CLIENT.get_table(table_ref)

self.assertEqual(table.table_id, TABLE_ID)
self.assertEqual(table.dataset_id, DATASET_ID)
self.assertEqual(table.project, PUBLIC)
schema_names = [field.name for field in table.schema]
self.assertEqual(
schema_names, ['word', 'word_count', 'corpus', 'corpus_date'])

def test_list_tables(self):
DATASET_ID = _make_dataset_id('list_tables')
dataset = retry_403(Config.CLIENT.create_dataset)(Dataset(DATASET_ID))
Expand Down