From f02374bb10fbe662a915927c259b17f90b252763 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sun, 11 Oct 2015 07:59:03 -0400 Subject: [PATCH] ENH: Improvement to the BigQuery streaming insert failure message #11285 --- doc/source/whatsnew/v0.17.1.txt | 2 ++ pandas/io/gbq.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.17.1.txt b/doc/source/whatsnew/v0.17.1.txt index 668873e838597..41a3ea9347a04 100755 --- a/doc/source/whatsnew/v0.17.1.txt +++ b/doc/source/whatsnew/v0.17.1.txt @@ -20,6 +20,8 @@ Enhancements .. _whatsnew_0171.enhancements.other: +- Improve the error message in :func:`pandas.io.gbq.to_gbq` when a streaming insert fails (:issue:`11285`) + Other Enhancements ^^^^^^^^^^^^^^^^^^ diff --git a/pandas/io/gbq.py b/pandas/io/gbq.py index e9568db06f391..e7241036b94c4 100644 --- a/pandas/io/gbq.py +++ b/pandas/io/gbq.py @@ -185,7 +185,8 @@ def process_insert_errors(insert_errors, verbose): for error in errors: reason = error['reason'] message = error['message'] - error_message = 'Error at Row: {0}, Reason: {1}, Message: {2}'.format(row, reason, message) + location = error['location'] + error_message = 'Error at Row: {0}, Reason: {1}, Location: {2}, Message: {3}'.format(row, reason, location, message) # Report all error messages if verbose is set if verbose: