Skip to content

Improve the BigQuery streaming insert failure message #11285

Closed
@parthea

Description

@parthea

The error message shown when a BigQuery streaming insert fails could be improved by adding the location field.

Code to reproduce:

from datetime import datetime
from pandas import DataFrame
from pandas.io import gbq
import pytz

test_timestamp = datetime.now(pytz.timezone('US/Arizona'))
bad_df = DataFrame({'bools': [False, False], 'flts': [0.0, 1.0], 'ints': [0, '1'], 'strs': ['a', 1],
                    'times': [test_timestamp, test_timestamp]}, index=range(2))
gbq.to_gbq(bad_df, destination_table, project_id, verbose=True,if_exists='replace')

Output:

Streaming Insert is 100% Complete
Error at Row: 0, Reason: invalid, Message: Could not convert value to string
Error at Row: 1, Reason: invalid, Message: Could not convert value to string

Proposed output:

Streaming Insert is 100% Complete
Error at Row: 0, Reason: invalid, Location: Field:ints, Message: Could not convert value to string
Error at Row: 1, Reason: invalid, Location: Field:strs, Message: Could not convert value to string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Error ReportingIncorrect or improved errors from pandas

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions