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.
The existing pg_snippets already has this sample with autogenerated code. Do we still need this?
There was a problem hiding this comment.
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.
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.
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.
Will we be adding create_database sample for postgres? I think that is needed for customers to understand how to set a PG database.
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.
@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.
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