Repository: googleapis/google-cloud-python

Issue:
gcloud.datastore.connection should inherit from gcloud.connection
The only [generic](https://github.com/dhermes/gcloud-python/blob/4c7fa75d7892e8b70281b722953f43f39711eea8/gcloud/connection.py#L28) [methods](https://github.com/dhermes/gcloud-python/blob/4c7fa75d7892e8b70281b722953f43f39711eea8/gcloud/connection.py#L32) in `gcloud.connection` are [identically](https://github.com/dhermes/gcloud-python/blob/4c7fa75d7892e8b70281b722953f43f39711eea8/gcloud/datastore/connection.py#L37) [defined](https://github.com/dhermes/gcloud-python/blob/4c7fa75d7892e8b70281b722953f43f39711eea8/gcloud/datastore/connection.py#L41) in `gcloud.datastore.connection`.

I was adding a module docstring to `gcloud/connection.py` when I realized only one of our two implementations inherits from it.



Discussion:

Resolving patch:
diff --git a/gcloud/datastore/connection.py b/gcloud/datastore/connection.py
--- a/gcloud/datastore/connection.py
+++ b/gcloud/datastore/connection.py
@@ -1,12 +1,13 @@
 import httplib2
 
+from gcloud import connection
 from gcloud.datastore import datastore_v1_pb2 as datastore_pb
 from gcloud.datastore import helpers
 from gcloud.datastore.dataset import Dataset
 from gcloud.datastore.transaction import Transaction
 
 
-class Connection(object):
+class Connection(connection.Connection):
   """A connection to the Google Cloud Datastore via the Protobuf API.
 
   This class should understand only the basic types (and protobufs)
@@ -16,9 +17,6 @@ class Connection(object):
   :param credentials: The OAuth2 Credentials to use for this connection.
   """
 
-  API_BASE_URL = 'https://www.googleapis.com'
-  """The base of the API call URL."""
-
   API_VERSION = 'v1beta2'
   """The version of the API, used in building the API call's URL."""
 
@@ -26,31 +24,9 @@ class Connection(object):
                       '/datasets/{dataset_id}/{method}')
   """A template used to craft the URL pointing toward a particular API call."""
 
-  _EMPTY = object()
-  """A pointer to represent an empty value for default arguments."""
-
   def __init__(self, credentials=None):
     self._credentials = credentials
     self._current_transaction = None
-    self._http = None
-
-  @property
-  def credentials(self):
-    return self._credentials
-
-  @property
-  def http(self):
-    """A getter for the HTTP transport used in talking to the API.
-
-    :rtype: :class:`httplib2.Http`
-    :returns: A Http object used to transport data.
-    """
-
-    if not self._http:
-      self._http = httplib2.Http()
-      if self._credentials:
-        self._http = self._credentials.authorize(self._http)
-    return self._http
 
   def _request(self, dataset_id, method, data):
     """Make a request over the Http transport to the Cloud Datastore API.
@@ -117,7 +93,7 @@ def build_api_url(cls, dataset_id, method, base_url=None, api_version=None):
         api_version=(api_version or cls.API_VERSION),
         dataset_id=dataset_id, method=method)
 
-  def transaction(self, transaction=_EMPTY):
+  def transaction(self, transaction=connection.Connection._EMPTY):
     if transaction is self._EMPTY:
       return self._current_transaction
     else:


Test patch: