Skip to content

Commit

Permalink
fix(spanner): fix imports for doc samples (#10283)
Browse files Browse the repository at this point in the history
* 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 55a21d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
8 changes: 3 additions & 5 deletions docs/advanced-session-pool-topics.rst
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/batch-usage.rst
Expand Up @@ -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',)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions docs/client-usage.rst
Expand Up @@ -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
-------------------
Expand Down Expand Up @@ -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::

Expand Down
2 changes: 1 addition & 1 deletion docs/database-usage.rst
Expand Up @@ -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):
Expand Down

0 comments on commit 55a21d9

Please sign in to comment.