-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore: complete migration of google-cloud-spanner #16685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,16 @@ | ||
| { | ||
| "name": "spanner", | ||
| "name_pretty": "Cloud Spanner", | ||
| "product_documentation": "https://cloud.google.com/spanner/docs/", | ||
| "api_description": "is the world's first fully managed relational database service \nto offer both strong consistency and horizontal scalability for \nmission-critical online transaction processing (OLTP) applications. With Cloud \nSpanner you enjoy all the traditional benefits of a relational database; but \nunlike any other relational database service, Cloud Spanner scales horizontally \nto hundreds or thousands of servers to handle the biggest transactional \nworkloads.", | ||
| "api_id": "spanner.googleapis.com", | ||
| "api_shortname": "spanner", | ||
| "client_documentation": "https://cloud.google.com/python/docs/reference/spanner/latest", | ||
| "default_version": "v1", | ||
| "distribution_name": "google-cloud-spanner", | ||
| "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open", | ||
| "release_level": "stable", | ||
| "language": "python", | ||
| "library_type": "GAPIC_COMBO", | ||
| "repo": "googleapis/google-cloud-python", | ||
| "distribution_name": "google-cloud-spanner", | ||
| "api_id": "spanner.googleapis.com", | ||
| "requires_billing": true, | ||
| "default_version": "v1", | ||
| "codeowner_team": "@googleapis/spanner-team", | ||
| "api_shortname": "spanner", | ||
| "api_description": "is the world's first fully managed relational database service \nto offer both strong consistency and horizontal scalability for \nmission-critical online transaction processing (OLTP) applications. With Cloud \nSpanner you enjoy all the traditional benefits of a relational database; but \nunlike any other relational database service, Cloud Spanner scales horizontally \nto hundreds or thousands of servers to handle the biggest transactional \nworkloads." | ||
| } | ||
| "name": "spanner", | ||
| "name_pretty": "Cloud Spanner", | ||
| "product_documentation": "https://cloud.google.com/spanner/docs/", | ||
| "release_level": "stable", | ||
| "repo": "googleapis/google-cloud-python" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,6 @@ | |
| """ | ||
|
|
||
| import argparse | ||
|
|
||
| from enum import Enum | ||
|
|
||
|
|
||
|
|
@@ -29,14 +28,15 @@ def create_full_backup_schedule( | |
| schedule_id: str, | ||
| ) -> None: | ||
| from datetime import timedelta | ||
|
|
||
| from google.cloud import spanner | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| backup_schedule as backup_schedule_pb, | ||
| ) | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| CreateBackupEncryptionConfig, | ||
| FullBackupSpec, | ||
| ) | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| backup_schedule as backup_schedule_pb, | ||
| ) | ||
|
|
||
| client = spanner.Client() | ||
| database_admin_api = client.database_admin_api | ||
|
|
@@ -74,14 +74,15 @@ def create_incremental_backup_schedule( | |
| schedule_id: str, | ||
| ) -> None: | ||
| from datetime import timedelta | ||
|
|
||
| from google.cloud import spanner | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| backup_schedule as backup_schedule_pb, | ||
| ) | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| CreateBackupEncryptionConfig, | ||
| IncrementalBackupSpec, | ||
| ) | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| backup_schedule as backup_schedule_pb, | ||
| ) | ||
|
Comment on lines
79
to
+85
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These redundant imports from the same module can be merged into a single block for better readability and to avoid redundancy. This aligns with the rule to remove duplicate or redundant code to keep the codebase clean. from google.cloud.spanner_admin_database_v1.types import (
CreateBackupEncryptionConfig,
IncrementalBackupSpec,
backup_schedule as backup_schedule_pb,
)References
|
||
|
|
||
| client = spanner.Client() | ||
| database_admin_api = client.database_admin_api | ||
|
|
@@ -174,12 +175,13 @@ def update_backup_schedule( | |
| schedule_id: str, | ||
| ) -> None: | ||
| from datetime import timedelta | ||
|
|
||
| from google.cloud import spanner | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| backup_schedule as backup_schedule_pb, | ||
| CreateBackupEncryptionConfig, | ||
| ) | ||
| from google.cloud.spanner_admin_database_v1.types import ( | ||
| CreateBackupEncryptionConfig, | ||
| backup_schedule as backup_schedule_pb, | ||
| ) | ||
|
Comment on lines
180
to
185
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These redundant imports from the same module can be merged into a single block for better readability and to avoid redundancy. This aligns with the rule to remove duplicate or redundant code to keep the codebase clean. from google.cloud.spanner_admin_database_v1.types import (
CreateBackupEncryptionConfig,
backup_schedule as backup_schedule_pb,
)References
|
||
| from google.protobuf.field_mask_pb2 import FieldMask | ||
|
|
||
|
|
||
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.
These redundant imports from the same module can be merged into a single block for better readability and to avoid redundancy. This aligns with the rule to remove duplicate or redundant code to keep the codebase clean.
References