Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 792b9b9

Browse files
committed
feat: update image to us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:667c9c407ace8caf2deba85187536df8a091e7b05c78eea63eb01255fe17a8f3
1 parent 85443e4 commit 792b9b9

File tree

63 files changed

+815
-336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+815
-336
lines changed

.librarian/state.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
1+
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:667c9c407ace8caf2deba85187536df8a091e7b05c78eea63eb01255fe17a8f3
22
libraries:
33
- id: google-cloud-spanner
44
version: 3.63.0

docs/conf.py

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
16-
#
15+
##
1716
# google-cloud-spanner documentation build configuration file
1817
#
1918
# This file is execfile()d with the current directory set to its
@@ -25,9 +24,12 @@
2524
# All configuration values have a default; values that are commented out
2625
# serve to show the default.
2726

28-
import sys
27+
import logging
2928
import os
3029
import shlex
30+
import sys
31+
import logging
32+
from typing import Any
3133

3234
# If extensions (or modules to document with autodoc) are in another directory,
3335
# add these directories to sys.path here. If the directory is relative to the
@@ -383,3 +385,33 @@
383385
napoleon_use_ivar = False
384386
napoleon_use_param = True
385387
napoleon_use_rtype = True
388+
389+
# Setup for sphinx behaviors such as warning filters.
390+
class UnexpectedUnindentFilter(logging.Filter):
391+
"""Filter out warnings about unexpected unindentation following bullet lists."""
392+
393+
def filter(self, record: logging.LogRecord) -> bool:
394+
"""Filter the log record.
395+
396+
Args:
397+
record (logging.LogRecord): The log record.
398+
399+
Returns:
400+
bool: False to suppress the warning, True to allow it.
401+
"""
402+
msg = record.getMessage()
403+
if "Bullet list ends without a blank line" in msg:
404+
return False
405+
return True
406+
407+
408+
def setup(app: Any) -> None:
409+
"""Setup the Sphinx application.
410+
411+
Args:
412+
app (Any): The Sphinx application.
413+
"""
414+
# Sphinx's logger is hierarchical. Adding a filter to the
415+
# root 'sphinx' logger will catch warnings from all sub-loggers.
416+
logger = logging.getLogger('sphinx')
417+
logger.addFilter(UnexpectedUnindentFilter())

google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@
4545
except AttributeError: # pragma: NO COVER
4646
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
4747

48-
from google.api_core import operation # type: ignore
49-
from google.api_core import operation_async # type: ignore
50-
from google.iam.v1 import iam_policy_pb2 # type: ignore
51-
from google.iam.v1 import policy_pb2 # type: ignore
48+
import google.api_core.operation as operation # type: ignore
49+
import google.api_core.operation_async as operation_async # type: ignore
50+
import google.iam.v1.iam_policy_pb2 as iam_policy_pb2 # type: ignore
51+
import google.iam.v1.policy_pb2 as policy_pb2 # type: ignore
5252
from google.longrunning import operations_pb2 # type: ignore
53-
from google.protobuf import duration_pb2 # type: ignore
54-
from google.protobuf import empty_pb2 # type: ignore
55-
from google.protobuf import field_mask_pb2 # type: ignore
56-
from google.protobuf import timestamp_pb2 # type: ignore
53+
import google.longrunning.operations_pb2 as operations_pb2 # type: ignore
54+
import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
55+
import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
56+
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
57+
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
5758

5859
from google.cloud.spanner_admin_database_v1.services.database_admin import pagers
5960
from google.cloud.spanner_admin_database_v1.types import common, spanner_database_admin
@@ -160,7 +161,10 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
160161
Returns:
161162
DatabaseAdminAsyncClient: The constructed client.
162163
"""
163-
return DatabaseAdminClient.from_service_account_info.__func__(DatabaseAdminAsyncClient, info, *args, **kwargs) # type: ignore
164+
sa_info_func = (
165+
DatabaseAdminClient.from_service_account_info.__func__ # type: ignore
166+
)
167+
return sa_info_func(DatabaseAdminAsyncClient, info, *args, **kwargs)
164168

165169
@classmethod
166170
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -176,7 +180,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
176180
Returns:
177181
DatabaseAdminAsyncClient: The constructed client.
178182
"""
179-
return DatabaseAdminClient.from_service_account_file.__func__(DatabaseAdminAsyncClient, filename, *args, **kwargs) # type: ignore
183+
sa_file_func = (
184+
DatabaseAdminClient.from_service_account_file.__func__ # type: ignore
185+
)
186+
return sa_file_func(DatabaseAdminAsyncClient, filename, *args, **kwargs)
180187

181188
from_service_account_json = from_service_account_file
182189

@@ -226,7 +233,7 @@ def transport(self) -> DatabaseAdminTransport:
226233
return self._client.transport
227234

228235
@property
229-
def api_endpoint(self):
236+
def api_endpoint(self) -> str:
230237
"""Return the API endpoint used by the client instance.
231238
232239
Returns:
@@ -1327,7 +1334,7 @@ async def set_iam_policy(
13271334
# client as shown in:
13281335
# https://googleapis.dev/python/google-api-core/latest/client_options.html
13291336
from google.cloud import spanner_admin_database_v1
1330-
from google.iam.v1 import iam_policy_pb2 # type: ignore
1337+
import google.iam.v1.iam_policy_pb2 as iam_policy_pb2 # type: ignore
13311338
13321339
async def sample_set_iam_policy():
13331340
# Create a client
@@ -1474,7 +1481,7 @@ async def get_iam_policy(
14741481
# client as shown in:
14751482
# https://googleapis.dev/python/google-api-core/latest/client_options.html
14761483
from google.cloud import spanner_admin_database_v1
1477-
from google.iam.v1 import iam_policy_pb2 # type: ignore
1484+
import google.iam.v1.iam_policy_pb2 as iam_policy_pb2 # type: ignore
14781485
14791486
async def sample_get_iam_policy():
14801487
# Create a client
@@ -1622,7 +1629,7 @@ async def test_iam_permissions(
16221629
# client as shown in:
16231630
# https://googleapis.dev/python/google-api-core/latest/client_options.html
16241631
from google.cloud import spanner_admin_database_v1
1625-
from google.iam.v1 import iam_policy_pb2 # type: ignore
1632+
import google.iam.v1.iam_policy_pb2 as iam_policy_pb2 # type: ignore
16261633
16271634
async def sample_test_iam_permissions():
16281635
# Create a client
@@ -3980,7 +3987,7 @@ async def sample_internal_update_graph_operation():
39803987

39813988
async def list_operations(
39823989
self,
3983-
request: Optional[operations_pb2.ListOperationsRequest] = None,
3990+
request: Optional[Union[operations_pb2.ListOperationsRequest, dict]] = None,
39843991
*,
39853992
retry: OptionalRetry = gapic_v1.method.DEFAULT,
39863993
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
@@ -4006,8 +4013,12 @@ async def list_operations(
40064013
# Create or coerce a protobuf request object.
40074014
# The request isn't a proto-plus wrapped type,
40084015
# so it must be constructed via keyword expansion.
4009-
if isinstance(request, dict):
4010-
request = operations_pb2.ListOperationsRequest(**request)
4016+
if request is None:
4017+
request_pb = operations_pb2.ListOperationsRequest()
4018+
elif isinstance(request, dict):
4019+
request_pb = operations_pb2.ListOperationsRequest(**request)
4020+
else:
4021+
request_pb = request
40114022

40124023
# Wrap the RPC method; this adds retry and timeout information,
40134024
# and friendly error handling.
@@ -4016,15 +4027,15 @@ async def list_operations(
40164027
# Certain fields should be provided within the metadata header;
40174028
# add these here.
40184029
metadata = tuple(metadata) + (
4019-
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
4030+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
40204031
)
40214032

40224033
# Validate the universe domain.
40234034
self._client._validate_universe_domain()
40244035

40254036
# Send the request.
40264037
response = await rpc(
4027-
request,
4038+
request_pb,
40284039
retry=retry,
40294040
timeout=timeout,
40304041
metadata=metadata,
@@ -4035,7 +4046,7 @@ async def list_operations(
40354046

40364047
async def get_operation(
40374048
self,
4038-
request: Optional[operations_pb2.GetOperationRequest] = None,
4049+
request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
40394050
*,
40404051
retry: OptionalRetry = gapic_v1.method.DEFAULT,
40414052
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
@@ -4061,8 +4072,12 @@ async def get_operation(
40614072
# Create or coerce a protobuf request object.
40624073
# The request isn't a proto-plus wrapped type,
40634074
# so it must be constructed via keyword expansion.
4064-
if isinstance(request, dict):
4065-
request = operations_pb2.GetOperationRequest(**request)
4075+
if request is None:
4076+
request_pb = operations_pb2.GetOperationRequest()
4077+
elif isinstance(request, dict):
4078+
request_pb = operations_pb2.GetOperationRequest(**request)
4079+
else:
4080+
request_pb = request
40664081

40674082
# Wrap the RPC method; this adds retry and timeout information,
40684083
# and friendly error handling.
@@ -4071,15 +4086,15 @@ async def get_operation(
40714086
# Certain fields should be provided within the metadata header;
40724087
# add these here.
40734088
metadata = tuple(metadata) + (
4074-
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
4089+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
40754090
)
40764091

40774092
# Validate the universe domain.
40784093
self._client._validate_universe_domain()
40794094

40804095
# Send the request.
40814096
response = await rpc(
4082-
request,
4097+
request_pb,
40834098
retry=retry,
40844099
timeout=timeout,
40854100
metadata=metadata,
@@ -4090,7 +4105,7 @@ async def get_operation(
40904105

40914106
async def delete_operation(
40924107
self,
4093-
request: Optional[operations_pb2.DeleteOperationRequest] = None,
4108+
request: Optional[Union[operations_pb2.DeleteOperationRequest, dict]] = None,
40944109
*,
40954110
retry: OptionalRetry = gapic_v1.method.DEFAULT,
40964111
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
@@ -4120,8 +4135,12 @@ async def delete_operation(
41204135
# Create or coerce a protobuf request object.
41214136
# The request isn't a proto-plus wrapped type,
41224137
# so it must be constructed via keyword expansion.
4123-
if isinstance(request, dict):
4124-
request = operations_pb2.DeleteOperationRequest(**request)
4138+
if request is None:
4139+
request_pb = operations_pb2.DeleteOperationRequest()
4140+
elif isinstance(request, dict):
4141+
request_pb = operations_pb2.DeleteOperationRequest(**request)
4142+
else:
4143+
request_pb = request
41254144

41264145
# Wrap the RPC method; this adds retry and timeout information,
41274146
# and friendly error handling.
@@ -4130,23 +4149,23 @@ async def delete_operation(
41304149
# Certain fields should be provided within the metadata header;
41314150
# add these here.
41324151
metadata = tuple(metadata) + (
4133-
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
4152+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
41344153
)
41354154

41364155
# Validate the universe domain.
41374156
self._client._validate_universe_domain()
41384157

41394158
# Send the request.
41404159
await rpc(
4141-
request,
4160+
request_pb,
41424161
retry=retry,
41434162
timeout=timeout,
41444163
metadata=metadata,
41454164
)
41464165

41474166
async def cancel_operation(
41484167
self,
4149-
request: Optional[operations_pb2.CancelOperationRequest] = None,
4168+
request: Optional[Union[operations_pb2.CancelOperationRequest, dict]] = None,
41504169
*,
41514170
retry: OptionalRetry = gapic_v1.method.DEFAULT,
41524171
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
@@ -4175,8 +4194,12 @@ async def cancel_operation(
41754194
# Create or coerce a protobuf request object.
41764195
# The request isn't a proto-plus wrapped type,
41774196
# so it must be constructed via keyword expansion.
4178-
if isinstance(request, dict):
4179-
request = operations_pb2.CancelOperationRequest(**request)
4197+
if request is None:
4198+
request_pb = operations_pb2.CancelOperationRequest()
4199+
elif isinstance(request, dict):
4200+
request_pb = operations_pb2.CancelOperationRequest(**request)
4201+
else:
4202+
request_pb = request
41804203

41814204
# Wrap the RPC method; this adds retry and timeout information,
41824205
# and friendly error handling.
@@ -4185,15 +4208,15 @@ async def cancel_operation(
41854208
# Certain fields should be provided within the metadata header;
41864209
# add these here.
41874210
metadata = tuple(metadata) + (
4188-
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
4211+
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
41894212
)
41904213

41914214
# Validate the universe domain.
41924215
self._client._validate_universe_domain()
41934216

41944217
# Send the request.
41954218
await rpc(
4196-
request,
4219+
request_pb,
41974220
retry=retry,
41984221
timeout=timeout,
41994222
metadata=metadata,

0 commit comments

Comments
 (0)