diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2016-04-15 14:44:59 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2016-04-15 14:53:54 -0700 |
commit | ac4251aa0e973e3b2bdcf640afcb831744cf8777 (patch) | |
tree | 6f4b6daf815a1fedb2dd58b47b056db9a067eeee /tools/gcp/utils | |
parent | 92265f6904b238ed9af524c2816490445d60d90b (diff) |
fix error handling in big_query_utils.insert_rows
Diffstat (limited to 'tools/gcp/utils')
-rwxr-xr-x | tools/gcp/utils/big_query_utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/gcp/utils/big_query_utils.py b/tools/gcp/utils/big_query_utils.py index 913afd059e..9dbc69c5d6 100755 --- a/tools/gcp/utils/big_query_utils.py +++ b/tools/gcp/utils/big_query_utils.py @@ -119,9 +119,13 @@ def insert_rows(big_query, project_id, dataset_id, table_id, rows_list): tableId=table_id, body=body) res = insert_req.execute(num_retries=NUM_RETRIES) + if res.get('insertErrors', None): + print 'Error inserting rows! Response: %s' % res + is_success = False except HttpError as http_error: - print 'Error in inserting rows in the table %s' % table_id + print 'Error inserting rows to the table %s' % table_id is_success = False + return is_success |