-
Notifications
You must be signed in to change notification settings - Fork 93
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
docs: samples and tests for admin database APIs #1099
Conversation
Here is the summary of changes. You are about to add 29 region tags.
This comment is generated by snippet-bot.
|
c1676a7
to
724b7e8
Compare
724b7e8
to
99367f2
Compare
Reviewed samples.py. Will look at pg samples tomorrow. |
OPERATION_TIMEOUT_SECONDS = 240 | ||
|
||
|
||
def create_table_with_datatypes(instance_id, database_id): |
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.
The existing pg_snippets already has this sample with autogenerated code. Do we still need this?
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.
Yes we need this because there is dependency on this sample in other tests.
assert "Created Venues table on database" in out | ||
|
||
|
||
@pytest.mark.dependency(name="add_jsonb_column", depends=["insert_datatypes_data"]) |
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.
The dependency for this test insert_datatypes_data
is not there. How do we validate the sample since it will always get skipped.
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.
Updated dependency to create_table_with_datatypes since we need tables to be created.
# limitations under the License. | ||
|
||
"""This application demonstrates how to do basic operations using Cloud | ||
Spanner PostgreSql dialect. |
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.
Will we be adding create_database
sample for postgres? I think that is needed for customers to understand how to set a PG database.
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.
Added
81530ac
to
f18d0e1
Compare
d9be1fb
to
ed20cd5
Compare
database_dialect=DatabaseDialect.POSTGRESQL, | ||
) | ||
|
||
operation = spanner_client.database_admin_api.create_database(request=request) |
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.
@rahul2393
Do we need to take care of client closure as discussed in Nodejs?
googleapis/nodejs-spanner#1994 (comment)
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.
We are only initializing admin clients once per client object lifecycle
https://github.com/googleapis/python-spanner/blob/main/google/cloud/spanner_v1/client.py#L244
There is exit method in all of the autogenerated classes which get's called when object is ready for garbage collection.
Notes
depends on: #1065