Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Raised ArrowTypeError should indicates which column is causing the error #1822

Closed

Description

@aaaaahaaaaa

Debugging typing errors when working with existing tables with a large number of columns is extremely frustrating, to say the least: the pyarrow error never indicates which column is causing the issue.

It would be an absolute life saver if more debugging information were raised with the exception.

E.g.:

pyarrow.lib.ArrowTypeError: object of type <class 'str'> cannot be converted to int

Activity

  1. added
    api: bigquery
    on Feb 20, 2024
  2. Linchin commented on Feb 20, 2024

    @Linchin
    Contributor

    Thank you @aaaaahaaaaa for raising the issue. This error message seems to be raised directly by pyarrow, and we might be able to wrap some more useful information outside of it. Could you provide a minimal code snippet that reproduces the issue, so I can locate the exact place the exception is raised?

  3. added
    type: feature request
    priority: p3
    on Feb 20, 2024
  4. aaaaahaaaaa commented on Feb 21, 2024

    @aaaaahaaaaa
    Author

    Here is a minimal example:

    import google.auth
    import pandas as pd
    from google.cloud import bigquery
    
    credentials, project = google.auth.default()
    
    client = bigquery.Client(credentials=credentials, project=project)
    table_id = "TABLE_ID"
    
    data = {"what": "ever"}
    df = pd.DataFrame([data])
    
    job_config = bigquery.LoadJobConfig(schema=[bigquery.SchemaField("what", "INTEGER")])
    
    job = client.load_table_from_dataframe(df, table_id, job_config=job_config)
    job.result()

    Error (doesn't show any debugging information referring to the field what):

    pyarrow.lib.ArrowInvalid: Could not convert 'ever' with type str: tried to convert to int64
    
  5. chalmerlowe commented on Mar 11, 2024

    @chalmerlowe
    Collaborator

    At this time, I am pushing to get PR #1836 finished so we can close this out.

    It appears that we have about three PRs generated by three different folks that are related and focused on similar problems. Aiming to have #1836 be the main focal point and will close out the other two PRs. Unique characteristics of each, where reasonable, will be incorporated into #1836.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigquerypriority: p3type: feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions