Skip to content

Commit 43e61c1

Browse files
committed
Fix: typo & code style fix
1 parent 0378ab0 commit 43e61c1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bigquery/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -804,24 +804,24 @@ def _get_all_tables(self, dataset_id, cache=False):
804804
a dictionary of app ids mapped to their table names.
805805
"""
806806
do_fetch = True
807-
if cache is True and self.cache.get(dataset_id) is not None:
807+
if cache and self.cache.get(dataset_id):
808808
time, result = self.cache.get(dataset_id)
809809
if datetime.now() - time < CACHE_TIMEOUT:
810810
do_fetch = False
811811

812-
if do_fetch is True:
812+
if do_fetch:
813813
result = self.bigquery.tables().list(
814814
projectId=self.project_id,
815815
datasetId=dataset_id).execute()
816816

817-
page_token = result.get('nextPageToken', '')
818-
while len(page_token) > 0:
817+
page_token = result.get('nextPageToken')
818+
while page_token:
819819
res = self.bigquery.tables().list(
820820
projectId=self.project_id,
821821
datasetId=dataset_id,
822822
pageToken=page_token
823823
).execute()
824-
page_token = res.get('nextPageToekn', '')
824+
page_token = res.get('nextPageToken')
825825
result['tables'] += res.get('tables', [])
826826
self.cache[dataset_id] = (datetime.now(), result)
827827

0 commit comments

Comments
 (0)