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

ENH: Add user-agent string when constructing BigQuery and BigQuery Storage API clients. #281

@tswast

Description

@tswast

It would help me prioritize work on pandas-gbq if Google could see how much BigQuery usage originates from pandas-gbq. Plus, it's actually required by the Google APIs terms of service that we accurately identify our "application" accurately in requests to Google APIs.

To do this, we need to populate the user_agent property of google.api_core.client_info.ClientInfo or google.api_core.gapic_v1.client_info.ClientInfo when we construct a bigquery.Client or bigquery_storage_v1beta1.Client, respectively.

I propose we use the pandas version information in this string, as pandas seems to be the "application", since this package exists to ith pandas.read_gbq.

bigquery.Client(
    client_info=ClientInfo(
        user_agent="pandas-{}".format(get the pandas version)
    )
)

Related: googleapis/google-cloud-python#8696

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions