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: