tylertreat/BigQuery-Python — pull request #20 by pirsquare (2014-08-30 21:23:01+00:00)
Title: Bugfix on error handler & added allowLargeResults for table write

Regarding `func:wait_for_job`

1) There is no `jobComplete` in response for jobs.insert api. We can use `job_resource.get('status').get('state') == u'DONE'` to determine if job has completed

2) `job_resource.get('error')` won't retrieve any error message. We can use `job_resource.get('status').get('errorResult')` to get the error message.

For illustration, here's a short excerpt of a response with error (unicode removed for readability).

```
"status": {
"state": "DONE",
"errorResult": {
"reason": "responseTooLarge",
"message": "Response too large to return."
},
"errors": [{
"reason": "responseTooLarge",
"message": "Response too large to return."
}]
},
```