Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tswast opened this issue Jul 17, 2019 · 3 comments · Fixed by #8713 or #8734
Closed

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

tswast opened this issue Jul 17, 2019 · 3 comments · Fixed by #8713 or #8734
Assignees
Labels
api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tswast
Copy link
Contributor

tswast commented Jul 17, 2019

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__)
    )
)
@tswast
Copy link
Contributor Author

tswast commented Jul 22, 2019

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

@tswast
Copy link
Contributor Author

tswast commented Jul 22, 2019

needs the other ClientInfo class.

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

@tswast tswast changed the title BigQuery: Add user-agent info to Jupyter magics Client constructor. BigQuery: Add user-agent info to Jupyter magics Client constructor(s). Jul 22, 2019
@plamut
Copy link
Contributor

plamut commented Jul 22, 2019

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
Labels
api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
2 participants