From ceed0c09dca01582cbf59e46b011c13b74f2e36a Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Mon, 21 Dec 2015 15:20:42 -0500 Subject: [PATCH] Fix 'Client.list_jobs' to use 'full' projection. We can't parse/create job instances w/o full configuration. --- gcloud/bigquery/client.py | 2 +- gcloud/bigquery/test_client.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gcloud/bigquery/client.py b/gcloud/bigquery/client.py index 282d26ab76ba..0870837bdde8 100644 --- a/gcloud/bigquery/client.py +++ b/gcloud/bigquery/client.py @@ -159,7 +159,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None, retrieved with another call, passing that value as ``page_token``). """ - params = {} + params = {'projection': 'full'} if max_results is not None: params['maxResults'] = max_results diff --git a/gcloud/bigquery/test_client.py b/gcloud/bigquery/test_client.py index 017e780292a6..1a6c64f9eedb 100644 --- a/gcloud/bigquery/test_client.py +++ b/gcloud/bigquery/test_client.py @@ -260,7 +260,7 @@ def test_list_jobs_defaults(self): req = conn._requested[0] self.assertEqual(req['method'], 'GET') self.assertEqual(req['path'], '/%s' % PATH) - self.assertEqual(req['query_params'], {}) + self.assertEqual(req['query_params'], {'projection': 'full'}) def test_list_jobs_explicit_empty(self): PROJECT = 'PROJECT' @@ -282,7 +282,8 @@ def test_list_jobs_explicit_empty(self): self.assertEqual(req['method'], 'GET') self.assertEqual(req['path'], '/%s' % PATH) self.assertEqual(req['query_params'], - {'maxResults': 1000, + {'projection': 'full', + 'maxResults': 1000, 'pageToken': TOKEN, 'allUsers': True, 'stateFilter': 'done'})