Skip to content
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

fix(spanner): fix imports for doc samples #10283

Merged
merged 2 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions spanner/docs/advanced-session-pool-topics.rst
Original file line number Diff line number Diff line change
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 spanner/docs/batch-usage.rst
Original file line number Diff line number Diff line change
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=[
('[email protected]',)
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 spanner/docs/client-usage.rst
Original file line number Diff line number Diff line change
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 spanner/docs/database-usage.rst
Original file line number Diff line number Diff line change
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