From cd35df511b98cf9f5165b20029abb556b90e5ec9 Mon Sep 17 00:00:00 2001 From: larkee Date: Fri, 31 Jan 2020 13:13:54 +1100 Subject: [PATCH 1/2] fix(spanner): fix imports for doc samples --- spanner/docs/advanced-session-pool-topics.rst | 8 +++----- spanner/docs/batch-usage.rst | 4 ++-- spanner/docs/client-usage.rst | 12 ++++++------ spanner/docs/database-usage.rst | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/spanner/docs/advanced-session-pool-topics.rst b/spanner/docs/advanced-session-pool-topics.rst index b8b4e8c9253a..18fd7db64c1b 100644 --- a/spanner/docs/advanced-session-pool-topics.rst +++ b/spanner/docs/advanced-session-pool-topics.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) diff --git a/spanner/docs/batch-usage.rst b/spanner/docs/batch-usage.rst index d0f38a63b2df..419ca106e6cc 100644 --- a/spanner/docs/batch-usage.rst +++ b/spanner/docs/batch-usage.rst @@ -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) diff --git a/spanner/docs/client-usage.rst b/spanner/docs/client-usage.rst index f0340d3111b5..801c9cb135da 100644 --- a/spanner/docs/client-usage.rst +++ b/spanner/docs/client-usage.rst @@ -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:: diff --git a/spanner/docs/database-usage.rst b/spanner/docs/database-usage.rst index 5d47d71cdc82..ee2b5dca91c4 100644 --- a/spanner/docs/database-usage.rst +++ b/spanner/docs/database-usage.rst @@ -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 import AbstractSessionPool class MyCustomPool(AbstractSessionPool): From 43b76c25de86623cd87b9cda3496dbfcbb62a22f Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Fri, 31 Jan 2020 12:42:52 -0800 Subject: [PATCH 2/2] Update database-usage.rst --- spanner/docs/database-usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spanner/docs/database-usage.rst b/spanner/docs/database-usage.rst index ee2b5dca91c4..8989501a7d6a 100644 --- a/spanner/docs/database-usage.rst +++ b/spanner/docs/database-usage.rst @@ -230,7 +230,7 @@ contract laid out in :class:`~google.cloud.spanner.pool.AbstractSessionPool`: .. code-block:: python - from google.cloud import AbstractSessionPool + from google.cloud.spanner import AbstractSessionPool class MyCustomPool(AbstractSessionPool):