Skip to content

Commit 55a21d9

Browse files
larkeecrwilcox
andauthored
fix(spanner): fix imports for doc samples (#10283)
* fix(spanner): fix imports for doc samples * Update database-usage.rst Co-authored-by: Christopher Wilcox <[email protected]>
1 parent e072d5d commit 55a21d9

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

docs/advanced-session-pool-topics.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ contract laid out in
1010

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

4444
.. code-block:: python
4545
46-
from google.cloud.spanner import Client
47-
from google.cloud.spanner.pool import PingingPool
46+
from google.cloud.spanner import Client, PingingPool
4847
4948
client = Client()
5049
instance = client.instance(INSTANCE_NAME)
@@ -77,8 +76,7 @@ Create an instance of
7776

7877
.. code-block:: python
7978
80-
from google.cloud.spanner import Client
81-
from google.cloud.spanner.pool import TransactionPingingPool
79+
from google.cloud.spanner import Client, TransactionPingingPool
8280
8381
client = Client()
8482
instance = client.instance(INSTANCE_NAME)

docs/batch-usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ rows do not cause errors.
132132

133133
.. code:: python
134134
135-
from google.cloud.spanner.keyset import KeySet
135+
from google.cloud.spanner import KeySet
136136
137137
to_delete = KeySet(keys=[
138138
@@ -165,7 +165,7 @@ if the ``with`` block exits without raising an exception.
165165

166166
.. code:: python
167167
168-
from google.cloud.spanner.keyset import KeySet
168+
from google.cloud.spanner import KeySet
169169
170170
client = spanner.Client()
171171
instance = client.instance(INSTANCE_NAME)

docs/client-usage.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ and creating other objects:
1313

1414
.. code:: python
1515
16-
from google.cloud import spanner_v1
17-
client = spanner_v1.Client()
16+
from google.cloud import spanner
17+
client = spanner.Client()
1818
1919
Long-lived Defaults
2020
-------------------
@@ -47,15 +47,15 @@ Configuration
4747

4848
.. code::
4949
50-
>>> from google.cloud import spanner_v1
51-
>>> client = spanner_v1.Client()
50+
>>> from google.cloud import spanner
51+
>>> client = spanner.Client()
5252
5353
or pass in ``credentials`` and ``project`` explicitly
5454

5555
.. code::
5656
57-
>>> from google.cloud import spanner_v1
58-
>>> client = spanner_v1.Client(project='my-project', credentials=creds)
57+
>>> from google.cloud import spanner
58+
>>> client = spanner.Client(project='my-project', credentials=creds)
5959
6060
.. tip::
6161

docs/database-usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ contract laid out in :class:`~google.cloud.spanner.pool.AbstractSessionPool`:
230230

231231
.. code-block:: python
232232
233-
from google.cloud.pool import AbstractSessionPool
233+
from google.cloud.spanner import AbstractSessionPool
234234
235235
class MyCustomPool(AbstractSessionPool):
236236

0 commit comments

Comments
 (0)