Skip to content

BigQuery: Add user-agent info to Jupyter magics Client constructor(s). #8696

Description

@tswast

In order to better prioritize jupyter features such as #8342 and #8143, it is important for Google to know how much these features are used to query BigQuery. This is done by populating the user-agent string with the corresponding "application name" and version information.

I propose we use the IPython version information in this string, as these magics are being used from an IPython kernel. Getting the IPython version string: https://stackoverflow.com/a/56265255/101923 Something like:

bigquery.Client(
    client_info=ClientInfo(
        user_agent="ipython-{}".format(IPython.__version__)
    )
)

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    api: bigqueryIssues related to the BigQuery API.
    on Jul 17, 2019
  2. reopened this on Jul 22, 2019
  3. tswast commented on Jul 22, 2019

    @tswast
    ContributorAuthor

    Re-opening. I forgot to mention we create another client that'll need similar treatment. We can construct a BigQuery Storage API client, which is a gapic client, so needs the other ClientInfo class.

    https://github.com/plamut/google-cloud-python/blob/7b6aecc10ed355b7b81ceb7bbe56000ebc0dd778/bigquery/google/cloud/bigquery/magics.py#L442

  4. tswast commented on Jul 22, 2019

    @tswast
    ContributorAuthor

    needs the other ClientInfo class.

    Since the grpc stuff is an optional dependency, let's import it in the _make_bqstorage_client function.

  5. changed the title [-]BigQuery: Add user-agent info to Jupyter magics Client constructor.[/-] [+]BigQuery: Add user-agent info to Jupyter magics Client constructor(s).[/+] on Jul 22, 2019
  6. plamut commented on Jul 22, 2019

    @plamut
    Contributor

    Thanks for the update, I will look at that as well.

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

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions