-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add gccl metrics header to Spanner. #3045
Add gccl metrics header to Spanner. #3045
Conversation
spanner/unit_tests/test_client.py
Outdated
@@ -114,7 +151,8 @@ def test_instance_admin_api(self): | |||
client = self._make_one(project=self.PROJECT, credentials=creds) | |||
|
|||
class _Client(object): | |||
pass | |||
def __init__(self, *args, **kwargs): | |||
pass |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/unit_tests/test_client.py
Outdated
@@ -131,7 +169,8 @@ def test_database_admin_api(self): | |||
client = self._make_one(project=self.PROJECT, credentials=creds) | |||
|
|||
class _Client(object): | |||
pass | |||
def __init__(self, *args, **kwargs): | |||
pass |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The PR should also be rebased against current |
1f06db0
to
a8169f2
Compare
@@ -15,6 +15,10 @@ | |||
"""Cloud Spanner API package.""" | |||
|
|||
|
|||
import pkg_resources | |||
__version__ = pkg_resources.get_distribution('google-cloud-spanner').version |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -179,7 +180,8 @@ def ddl_statements(self): | |||
def spanner_api(self): | |||
"""Helper for session-related API calls.""" | |||
if self._spanner_api is None: | |||
self._spanner_api = SpannerClient() | |||
self._spanner_api = SpannerClient(lib_name='gccl', | |||
lib_version=__version__) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -59,7 +59,7 @@ | |||
|
|||
setup( | |||
name='google-cloud-spanner', | |||
version='0.23.1', | |||
version='0.23.2', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
spanner/unit_tests/test_client.py
Outdated
def test_admin_api_lib_name(self): | ||
"""Establish that the lib_name and lib_version are passed to | ||
the database and instance API objects in the GAPIC. | ||
""" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
pass | ||
def __init__(self, *args, **kwargs): | ||
self.args = args | ||
self.kwargs = kwargs |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -106,6 +106,43 @@ def test_constructor_credentials_wo_create_scoped(self): | |||
expected_scopes = None | |||
self._constructor_test_helper(expected_scopes, creds) | |||
|
|||
def test_admin_api_lib_name(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ad8590a
to
87b2c55
Compare
Travis seems to be hung? Anyone know if I can do anything about this? |
@lukesneeringer there isn't anything you can do about Travis AFAICT. CircleCI should have covered it though so you should be clear to merge anyway in this case. |
Okay, merging once @tseaver gives assent. |
spanner/unit_tests/test_database.py
Outdated
@@ -188,7 +190,10 @@ def test_spanner_api_property(self): | |||
_client = object() | |||
_clients = [_client] | |||
|
|||
def _mock_spanner_client(): | |||
def _mock_spanner_client(*args, **kwargs): | |||
self.assertIsInstance(args, (list, tuple)) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
LGTM |
@lukesneeringer FWIW, your docstring-in-a-testcase here will be literally the only one in the whole codebase. If you feel that strongly about it, go ahead and merge. |
I went ahead and removed it. |
This PR adds the
gccl/x.y.z
portion of the metrics header in the Spanner client library.