Uh oh!
There was an error while loading. Please reload this page.
feat(spanner): add samples for instance partitions - #1168
Conversation
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
| def test_create_instance_partition(capsys, instance_partition_instance_id): | ||
| spanner_client = spanner.Client() | ||
| operation = spanner_client.instance_admin_api.create_instance( |
There was a problem hiding this comment.
Can we follow one of the 2 approaches,
- We can re-use existing instance that is already created in .
This will prevent instance creation time when running tests and also reduce the no of instances that get created.
This test can be marked as dependent to the instance creation test like
- If above one is complicated, then can we directly use snippets.create_instance to create an instance instead of rewriting the create logic here?
There was a problem hiding this comment.
I implemented Approach 2. The challenge with reusing an existing instance is that there are several restrictions around instance partitions. Notably:
- An instance partition cannot have the same instance config as the parent instance
- Several Spanner features do not work in instances where the user has created one or more instance partitions.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕