Skip to content

Commit

Permalink
chore: changing default region to us-west1 (googleapis#640)
Browse files Browse the repository at this point in the history
* chore: changing default region to us-west1

* chore(deps): update all dependencies (googleapis#602)

* chore: add default_version and codeowner_team to .repo-metadata.json (googleapis#641)

* feat(db_api): support stale reads (googleapis#584)

* feat: removing changes from samples

* chore: change region

* fix: fix in sample list-backups

Co-authored-by: WhiteSource Renovate <bot@renovateapp.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Ilya Gurov <ilya.faer@mail.ru>
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
  • Loading branch information
5 people authored and vi3k6i5 committed Mar 29, 2022
1 parent 73037ee commit 2b42b6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions samples/samples/backup_sample.py
Expand Up @@ -198,9 +198,9 @@ def list_backup_operations(instance_id, database_id):

# List the CreateBackup operations.
filter_ = (
"(metadata.database:{}) AND "
"(metadata.@type:type.googleapis.com/"
"google.spanner.admin.database.v1.CreateBackupMetadata)"
"google.spanner.admin.database.v1.CreateBackupMetadata) "
"AND (metadata.database:{})"
).format(database_id)
operations = instance.list_backup_operations(filter_=filter_)
for op in operations:
Expand Down
6 changes: 5 additions & 1 deletion tests/system/conftest.py
Expand Up @@ -93,7 +93,11 @@ def instance_config(instance_configs):
if not instance_configs:
raise ValueError("No instance configs found.")

yield instance_configs[0]
us_west1_config = [
config for config in instance_configs if config.display_name == "us-west1"
]
config = us_west1_config[0] if len(us_west1_config) > 0 else instance_configs[0]
yield config


@pytest.fixture(scope="session")
Expand Down
2 changes: 1 addition & 1 deletion tests/system/test_backup_api.py
Expand Up @@ -52,7 +52,7 @@ def same_config_instance(spanner_client, shared_instance, instance_operation_tim
@pytest.fixture(scope="session")
def diff_config(shared_instance, instance_configs):
current_config = shared_instance.configuration_name
for config in instance_configs:
for config in reversed(instance_configs):
if "-us-" in config.name and config.name != current_config:
return config.name
return None
Expand Down

0 comments on commit 2b42b6d

Please sign in to comment.