Skip to content
Permalink
Browse files
fix(spanner): fix imports for doc samples (#10283)
* fix(spanner): fix imports for doc samples

* Update database-usage.rst

Co-authored-by: Christopher Wilcox <crwilcox@google.com>
  • Loading branch information
larkee and crwilcox committed Jan 31, 2020
1 parent e072d5d commit 55a21d97d0c863cbbbb2d973b6faa4aeba8e38bb
Showing with 12 additions and 14 deletions.
  1. +3 −5 docs/advanced-session-pool-topics.rst
  2. +2 −2 docs/batch-usage.rst
  3. +6 −6 docs/client-usage.rst
  4. +1 −1 docs/database-usage.rst
@@ -10,7 +10,7 @@ contract laid out in

.. code-block:: python
from google.cloud.spanner.pool import AbstractSessionPool
from google.cloud.spanner import AbstractSessionPool
class MyCustomPool(AbstractSessionPool):
@@ -43,8 +43,7 @@ Create an instance of :class:`~google.cloud.spanner.pool.PingingPool`:

.. code-block:: python
from google.cloud.spanner import Client
from google.cloud.spanner.pool import PingingPool
from google.cloud.spanner import Client, PingingPool
client = Client()
instance = client.instance(INSTANCE_NAME)
@@ -77,8 +76,7 @@ Create an instance of

.. code-block:: python
from google.cloud.spanner import Client
from google.cloud.spanner.pool import TransactionPingingPool
from google.cloud.spanner import Client, TransactionPingingPool
client = Client()
instance = client.instance(INSTANCE_NAME)
@@ -132,7 +132,7 @@ rows do not cause errors.

.. code:: python
from google.cloud.spanner.keyset import KeySet
from google.cloud.spanner import KeySet
to_delete = KeySet(keys=[
('bharney@example.com',)
@@ -165,7 +165,7 @@ if the ``with`` block exits without raising an exception.

.. code:: python
from google.cloud.spanner.keyset import KeySet
from google.cloud.spanner import KeySet
client = spanner.Client()
instance = client.instance(INSTANCE_NAME)
@@ -13,8 +13,8 @@ and creating other objects:

.. code:: python
from google.cloud import spanner_v1
client = spanner_v1.Client()
from google.cloud import spanner
client = spanner.Client()
Long-lived Defaults
-------------------
@@ -47,15 +47,15 @@ Configuration

.. code::

>>> from google.cloud import spanner_v1
>>> client = spanner_v1.Client()
>>> from google.cloud import spanner
>>> client = spanner.Client()
or pass in ``credentials`` and ``project`` explicitly

.. code::

>>> from google.cloud import spanner_v1
>>> client = spanner_v1.Client(project='my-project', credentials=creds)
>>> from google.cloud import spanner
>>> client = spanner.Client(project='my-project', credentials=creds)
.. tip::

@@ -230,7 +230,7 @@ contract laid out in :class:`~google.cloud.spanner.pool.AbstractSessionPool`:

.. code-block:: python
from google.cloud.pool import AbstractSessionPool
from google.cloud.spanner import AbstractSessionPool
class MyCustomPool(AbstractSessionPool):

0 comments on commit 55a21d9

Please sign in to comment.