BigQuery: Set BQ storage client user-agent when in Jupyter cell#8734
BigQuery: Set BQ storage client user-agent when in Jupyter cell#8734tswast merged 5 commits intogoogleapis:masterfrom
Conversation
|
When running unit tests locally, I noticed that one of them fails here. The reason seems to be that My Update: The same happened in Kokoro checks, did not observe this yesterday... |
bigquery/tests/unit/test_magics.py
Outdated
| """Provide a patcher that can make the bigquery storage import to fail.""" | ||
| orig_import = six.moves.builtins.__import__ | ||
|
|
||
| def custom_import(name, globals=None, locals=None, fromlist=(), level=0): |
There was a problem hiding this comment.
Should we make this __import__ mock into a test utility (at https://github.com/googleapis/google-cloud-python/tree/master/test_utils/test_utils or maybe https://github.com/googleapis/google-cloud-python/blob/master/bigquery/tests/unit/helpers.py)?
Seems generally useful, and also something I'd like to see tests for.
There was a problem hiding this comment.
I'd say we put it in bigquery test utils for now, and ask other stakeholders if they are fine with promoting it to core test utils.
(there might be additional features/generalizations requested, but that would not block this particular PR)
There was a problem hiding this comment.
BTW, whom can I ask if the new helper is fit for promotion, who owns the core?
(if there isn't one and we can do it at our own discretion, please let me know)
There was a problem hiding this comment.
BTW, whom can I ask if the new helper is fit for promotion, who owns the core?
(if there isn't one and we can do it at our own discretion, please let me know)
I would say add a separate PR promoting it, and tag @busunkim96 for review.
c1b1afc to
b694a91
Compare
The client is a grpc client, thus the grpc ClientInfo class should be used to configure it.
Closes #8696
This is a follow-up to #8713, it adds the same user-agent string to the optional BQ storage client, if the latter is used.
How to test
See issue description and the subsequent comment about adding the user-agent info to the other client, too.