Skip to content

Commit 83334db

Browse files
committed
Convert to python3
1 parent 0edf54c commit 83334db

12 files changed

+5560
-23
lines changed

bigquery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from __future__ import absolute_import
1+
22

33
from .version import __version__
44

bigquery/__init__.py.bak

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from __future__ import absolute_import
2+
3+
from .version import __version__
4+
5+
from .client import get_client
6+
from .client import (
7+
BIGQUERY_SCOPE,
8+
BIGQUERY_SCOPE_READ_ONLY,
9+
JOB_CREATE_IF_NEEDED,
10+
JOB_CREATE_NEVER,
11+
JOB_SOURCE_FORMAT_NEWLINE_DELIMITED_JSON,
12+
JOB_SOURCE_FORMAT_DATASTORE_BACKUP,
13+
JOB_SOURCE_FORMAT_CSV,
14+
JOB_WRITE_TRUNCATE,
15+
JOB_WRITE_APPEND,
16+
JOB_WRITE_EMPTY,
17+
JOB_ENCODING_UTF_8,
18+
JOB_ENCODING_ISO_8859_1
19+
)
20+
21+
from .schema_builder import schema_from_record

bigquery/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def get_client(project_id=None, credentials=None,
124124

125125
if private_key:
126126
try:
127-
if isinstance(private_key, basestring):
127+
if isinstance(private_key, str):
128128
private_key = private_key.decode('utf-8')
129129
except NameError:
130130
# python3 -- private_key is already unicode
@@ -1213,7 +1213,7 @@ def wait_for_job(self, job, interval=5, timeout=60):
12131213
jobId=job_id)
12141214
job_resource = request.execute()
12151215
self._raise_executing_exception_if_error(job_resource)
1216-
complete = job_resource.get('status').get('state') == u'DONE'
1216+
complete = job_resource.get('status').get('state') == 'DONE'
12171217
elapsed_time = time() - start_time
12181218

12191219
# raise exceptions if timeout
@@ -1489,7 +1489,7 @@ def _filter_tables_by_time(self, tables, start_time, end_time):
14891489
Table names that are inside the time range
14901490
"""
14911491

1492-
return [table_name for (table_name, unix_seconds) in tables.items()
1492+
return [table_name for (table_name, unix_seconds) in list(tables.items())
14931493
if self._in_range(start_time, end_time, unix_seconds)]
14941494

14951495
def _in_range(self, start_time, end_time, time):

0 commit comments

Comments
 (0)