|
23 | 23 | from google.cloud.bigquery.job import LoadTableFromStorageJob |
24 | 24 | from google.cloud.bigquery.job import QueryJob |
25 | 25 | from google.cloud.bigquery.query import QueryResults |
26 | | -from google.cloud.iterator import Iterator |
| 26 | +from google.cloud.iterator import HTTPIterator |
27 | 27 |
|
28 | 28 |
|
29 | 29 | class Project(object): |
@@ -92,9 +92,10 @@ def list_projects(self, max_results=None, page_token=None): |
92 | 92 | :returns: Iterator of :class:`~google.cloud.bigquery.client.Project` |
93 | 93 | accessible to the current client. |
94 | 94 | """ |
95 | | - return Iterator(client=self, path='/projects', |
96 | | - items_key='projects', item_to_value=_item_to_project, |
97 | | - page_token=page_token, max_results=max_results) |
| 95 | + return HTTPIterator( |
| 96 | + client=self, path='/projects', item_to_value=_item_to_project, |
| 97 | + items_key='projects', page_token=page_token, |
| 98 | + max_results=max_results) |
98 | 99 |
|
99 | 100 | def list_datasets(self, include_all=False, max_results=None, |
100 | 101 | page_token=None): |
@@ -123,9 +124,9 @@ def list_datasets(self, include_all=False, max_results=None, |
123 | 124 | if include_all: |
124 | 125 | extra_params['all'] = True |
125 | 126 | path = '/projects/%s/datasets' % (self.project,) |
126 | | - return Iterator( |
127 | | - client=self, path=path, items_key='datasets', |
128 | | - item_to_value=_item_to_dataset, page_token=page_token, |
| 127 | + return HTTPIterator( |
| 128 | + client=self, path=path, item_to_value=_item_to_dataset, |
| 129 | + items_key='datasets', page_token=page_token, |
129 | 130 | max_results=max_results, extra_params=extra_params) |
130 | 131 |
|
131 | 132 | def dataset(self, dataset_name): |
@@ -204,9 +205,9 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None, |
204 | 205 | extra_params['stateFilter'] = state_filter |
205 | 206 |
|
206 | 207 | path = '/projects/%s/jobs' % (self.project,) |
207 | | - return Iterator( |
208 | | - client=self, path=path, items_key='jobs', |
209 | | - item_to_value=_item_to_job, page_token=page_token, |
| 208 | + return HTTPIterator( |
| 209 | + client=self, path=path, item_to_value=_item_to_job, |
| 210 | + items_key='jobs', page_token=page_token, |
210 | 211 | max_results=max_results, extra_params=extra_params) |
211 | 212 |
|
212 | 213 | def load_table_from_storage(self, job_name, destination, *source_uris): |
|
0 commit comments