GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — samples: add default leader options samples by zoercai · Pull Request #428 · googleapis/python-spanner

This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Conversation

@zoercai

@zoercai zoercai commented Jul 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Samples for #399. Implementation code will be gone once #399 is merged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
zoercai added 8 commits July 6, 2021 14:26
@zoercai
feat: add configurable leader placement support
d82d743
@zoercai
lint
35d8e3b
@zoercai
Merge branch 'master' of github.com:googleapis/python-spanner into cm…
c7b19a5
…mr-1
@zoercai
Create multi-regional instances
da35d33
@zoercai
try another print stmt
8f73d2c
@zoercai
try nam3
6bb7b0b
@zoercai
variable for config
e939fa7
@zoercai
samples: add default leader options samples
3ce1ed7
@zoercai
zoercai requested a review from a team July 26, 2021 12:40
@zoercai
zoercai requested a review from a team as a code owner July 26, 2021 12:40
@zoercai
zoercai requested review from crwilcox and removed request for a team July 26, 2021 12:40
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/python-spanner API. label Jul 26, 2021
@snippet-bot

snippet-bot Bot commented Jul 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 7 region tags.
  • samples/samples/snippets.py:99, tag spanner_get_instance_config
  • samples/samples/snippets.py:112, tag spanner_list_instance_configs
  • samples/samples/snippets.py:128, tag spanner_list_databases
  • samples/samples/snippets.py:218, tag spanner_create_database_with_default_leader
  • samples/samples/snippets.py:262, tag spanner_update_database_with_default_leader
  • samples/samples/snippets.py:288, tag spanner_get_database_ddl
  • samples/samples/snippets.py:303, tag spanner_query_information_schema_database_options

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Jul 26, 2021
@zoercai
zoercai requested a review from larkee July 26, 2021 12:40
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 26, 2021
@zoercai
zoercai requested a review from hengfengli July 26, 2021 12:41
zoercai added 3 commits July 27, 2021 11:59
@zoercai
fix
3e9137c
@zoercai
fix
384e1a2
@zoercai
fix
8004300
larkee
larkee suggested changes Jul 27, 2021
View reviewed changes

@larkee larkee left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, you are creating an instance within the spanner_create_database_with_default_leader and spanner_update_database_with_default_leader samples.

This is an issue as if there is a failure later on in the sample, the instance does not get cleaned up correctly. Additionally the second sample fails as it tried to create the same instance.

The instance creation should be removed from the samples and you should instead be using sample_instance, or a pytest fixture that uses sample_instance. This will ensure that the instance clean up is handled correctly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zoercai reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
zoercai added 6 commits July 27, 2021 18:51
@zoercai
use sample instance
f88634b
@zoercai
use new default leader instance
8d95511
@zoercai
fix
635b32d
@zoercai
underscore rather than dashes?
f4f2ede
@zoercai
fix
c68393e
@zoercai
add reload
86a64a2
larkee
larkee approved these changes Jul 28, 2021
View reviewed changes

@larkee larkee left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the implementation is merged and released 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@larkee larkee changed the title samples: add default leader options samples 3ce1ed7 samples: add default leader options samples Jul 28, 2021
@larkee larkee added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 28, 2021
@zoercai zoercai added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 28, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 28, 2021
@zoercai
Merge branch 'master' of github.com:googleapis/python-spanner into cm…
3c88ef0
…mr-1-samples

# Conflicts:
#	tests/system/test_system.py
@zoercai zoercai added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 29, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 29, 2021
@zoercai zoercai added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 29, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 29, 2021
larkee
larkee reviewed Jul 30, 2021
View reviewed changes

@larkee larkee left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having just written the samples for PHP I noticed some inconsistencies. Just a few changes for the list_* samples

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread samples/samples/snippets.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread samples/samples/snippets.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

zoercai added 2 commits August 3, 2021 10:58
@zoercai
Merge branch 'master' of github.com:googleapis/python-spanner into cm…
4d27834
…mr-1-samples
@zoercai
review changes
f46ee74
@larkee larkee removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 3, 2021
@zoercai zoercai added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 5, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 5, 2021
@hengfengli

hengfengli commented Aug 9, 2021

Copy link
Copy Markdown

@zoercai Why do we get an error Instance already exist?

value = None
from_value = <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.ALREADY_EXISTS
	details = "Instance already exist...message":"Instance already exists: projects/precise-truck-742/instances/google-cloud-1628122209464","grpc_status":6}"
>

>   ???
E   google.api_core.exceptions.AlreadyExists: 409 Instance already exists: projects/precise-truck-742/instances/google-cloud-1628122209464
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@larkee larkee added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 9, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 9, 2021
@larkee
larkee merged commit 86293f9 into googleapis:master Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@crwilcox crwilcox Awaiting requested review from crwilcox
@hengfengli hengfengli Awaiting requested review from hengfengli
1 more reviewer
@larkee larkee larkee approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: spanner Issues related to the googleapis/python-spanner API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@zoercai @hengfengli @larkee @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.