1515"""Base classes and helpers for job classes."""
1616
1717import copy
18+ import http
1819import threading
1920
2021from google .api_core import exceptions
2122import google .api_core .future .polling
22- from six .moves import http_client
2323
2424from google .cloud .bigquery import _helpers
2525from google .cloud .bigquery .retry import DEFAULT_RETRY
2828_DONE_STATE = "DONE"
2929_STOPPED_REASON = "stopped"
3030_ERROR_REASON_TO_EXCEPTION = {
31- "accessDenied" : http_client .FORBIDDEN ,
32- "backendError" : http_client .INTERNAL_SERVER_ERROR ,
33- "billingNotEnabled" : http_client .FORBIDDEN ,
34- "billingTierLimitExceeded" : http_client .BAD_REQUEST ,
35- "blocked" : http_client .FORBIDDEN ,
36- "duplicate" : http_client .CONFLICT ,
37- "internalError" : http_client .INTERNAL_SERVER_ERROR ,
38- "invalid" : http_client .BAD_REQUEST ,
39- "invalidQuery" : http_client .BAD_REQUEST ,
40- "notFound" : http_client .NOT_FOUND ,
41- "notImplemented" : http_client .NOT_IMPLEMENTED ,
42- "quotaExceeded" : http_client .FORBIDDEN ,
43- "rateLimitExceeded" : http_client .FORBIDDEN ,
44- "resourceInUse" : http_client .BAD_REQUEST ,
45- "resourcesExceeded" : http_client .BAD_REQUEST ,
46- "responseTooLarge" : http_client .FORBIDDEN ,
47- "stopped" : http_client .OK ,
48- "tableUnavailable" : http_client .BAD_REQUEST ,
31+ "accessDenied" : http . client .FORBIDDEN ,
32+ "backendError" : http . client .INTERNAL_SERVER_ERROR ,
33+ "billingNotEnabled" : http . client .FORBIDDEN ,
34+ "billingTierLimitExceeded" : http . client .BAD_REQUEST ,
35+ "blocked" : http . client .FORBIDDEN ,
36+ "duplicate" : http . client .CONFLICT ,
37+ "internalError" : http . client .INTERNAL_SERVER_ERROR ,
38+ "invalid" : http . client .BAD_REQUEST ,
39+ "invalidQuery" : http . client .BAD_REQUEST ,
40+ "notFound" : http . client .NOT_FOUND ,
41+ "notImplemented" : http . client .NOT_IMPLEMENTED ,
42+ "quotaExceeded" : http . client .FORBIDDEN ,
43+ "rateLimitExceeded" : http . client .FORBIDDEN ,
44+ "resourceInUse" : http . client .BAD_REQUEST ,
45+ "resourcesExceeded" : http . client .BAD_REQUEST ,
46+ "responseTooLarge" : http . client .FORBIDDEN ,
47+ "stopped" : http . client .OK ,
48+ "tableUnavailable" : http . client .BAD_REQUEST ,
4949}
5050
5151
@@ -66,7 +66,7 @@ def _error_result_to_exception(error_result):
6666 """
6767 reason = error_result .get ("reason" )
6868 status_code = _ERROR_REASON_TO_EXCEPTION .get (
69- reason , http_client .INTERNAL_SERVER_ERROR
69+ reason , http . client .INTERNAL_SERVER_ERROR
7070 )
7171 return exceptions .from_http_status (
7272 status_code , error_result .get ("message" , "" ), errors = [error_result ]
0 commit comments