From 3f6898eaf9252d68060bd3382925a462847e8177 Mon Sep 17 00:00:00 2001 From: Ryan Matsumoto Date: Wed, 30 Nov 2016 13:30:53 -0800 Subject: [PATCH] Changed error handling for all other big query samples as well --- bigquery/cloud-client/async_query.py | 2 +- bigquery/cloud-client/export_data_to_gcs.py | 2 +- bigquery/cloud-client/load_data_from_file.py | 2 +- bigquery/cloud-client/snippets.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bigquery/cloud-client/async_query.py b/bigquery/cloud-client/async_query.py index aa33973511..f90c8f2558 100755 --- a/bigquery/cloud-client/async_query.py +++ b/bigquery/cloud-client/async_query.py @@ -35,7 +35,7 @@ def wait_for_job(job): job.reload() # Refreshes the state via a GET request. if job.state == 'DONE': if job.error_result: - raise RuntimeError(job.error_result) + raise RuntimeError(job.errors) return time.sleep(1) diff --git a/bigquery/cloud-client/export_data_to_gcs.py b/bigquery/cloud-client/export_data_to_gcs.py index e9037ee015..3aee442c14 100644 --- a/bigquery/cloud-client/export_data_to_gcs.py +++ b/bigquery/cloud-client/export_data_to_gcs.py @@ -54,7 +54,7 @@ def wait_for_job(job): job.reload() if job.state == 'DONE': if job.error_result: - raise RuntimeError(job.error_result) + raise RuntimeError(job.errors) return time.sleep(1) diff --git a/bigquery/cloud-client/load_data_from_file.py b/bigquery/cloud-client/load_data_from_file.py index 80018f3fc8..0bbdd7ba7d 100644 --- a/bigquery/cloud-client/load_data_from_file.py +++ b/bigquery/cloud-client/load_data_from_file.py @@ -56,7 +56,7 @@ def wait_for_job(job): job.reload() if job.state == 'DONE': if job.error_result: - raise RuntimeError(job.error_result) + raise RuntimeError(job.errors) return time.sleep(1) diff --git a/bigquery/cloud-client/snippets.py b/bigquery/cloud-client/snippets.py index b02ac8ce61..f4294123d9 100644 --- a/bigquery/cloud-client/snippets.py +++ b/bigquery/cloud-client/snippets.py @@ -180,7 +180,7 @@ def wait_for_job(job): job.reload() # Refreshes the state via a GET request. if job.state == 'DONE': if job.error_result: - raise RuntimeError(job.error_result) + raise RuntimeError(job.errors) return time.sleep(1)