Skip to content

Commit 77552f3

Browse files
gcf-owl-bot[bot]vi3k6i5
authored andcommitted
fix: resolve DuplicateCredentialArgs error when using credentials_file (googleapis#676)
committer: parthea PiperOrigin-RevId: 425964861 Source-Link: googleapis/googleapis@84b1a5a Source-Link: https://github.com/googleapis/googleapis-gen/commit/4fb761bbd8506ac156f49bac5f18306aa8eb3aa8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZiNzYxYmJkODUwNmFjMTU2ZjQ5YmFjNWYxODMwNmFhOGViM2FhOCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f6fcf23 commit 77552f3

File tree

16 files changed

+336
-94
lines changed

16 files changed

+336
-94
lines changed

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

+17-17
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ async def list_databases(
274274
275275
"""
276276
# Create or coerce a protobuf request object.
277-
# Sanity check: If we got a request object, we should *not* have
277+
# Quick check: If we got a request object, we should *not* have
278278
# gotten any keyword arguments that map to the request.
279279
has_flattened_params = any([parent])
280280
if request is not None and has_flattened_params:
@@ -387,7 +387,7 @@ async def create_database(
387387
388388
"""
389389
# Create or coerce a protobuf request object.
390-
# Sanity check: If we got a request object, we should *not* have
390+
# Quick check: If we got a request object, we should *not* have
391391
# gotten any keyword arguments that map to the request.
392392
has_flattened_params = any([parent, create_statement])
393393
if request is not None and has_flattened_params:
@@ -467,7 +467,7 @@ async def get_database(
467467
A Cloud Spanner database.
468468
"""
469469
# Create or coerce a protobuf request object.
470-
# Sanity check: If we got a request object, we should *not* have
470+
# Quick check: If we got a request object, we should *not* have
471471
# gotten any keyword arguments that map to the request.
472472
has_flattened_params = any([name])
473473
if request is not None and has_flattened_params:
@@ -592,7 +592,7 @@ async def update_database_ddl(
592592
593593
"""
594594
# Create or coerce a protobuf request object.
595-
# Sanity check: If we got a request object, we should *not* have
595+
# Quick check: If we got a request object, we should *not* have
596596
# gotten any keyword arguments that map to the request.
597597
has_flattened_params = any([database, statements])
598598
if request is not None and has_flattened_params:
@@ -678,7 +678,7 @@ async def drop_database(
678678
sent along with the request as metadata.
679679
"""
680680
# Create or coerce a protobuf request object.
681-
# Sanity check: If we got a request object, we should *not* have
681+
# Quick check: If we got a request object, we should *not* have
682682
# gotten any keyword arguments that map to the request.
683683
has_flattened_params = any([database])
684684
if request is not None and has_flattened_params:
@@ -762,7 +762,7 @@ async def get_database_ddl(
762762
763763
"""
764764
# Create or coerce a protobuf request object.
765-
# Sanity check: If we got a request object, we should *not* have
765+
# Quick check: If we got a request object, we should *not* have
766766
# gotten any keyword arguments that map to the request.
767767
has_flattened_params = any([database])
768768
if request is not None and has_flattened_params:
@@ -906,7 +906,7 @@ async def set_iam_policy(
906906
907907
"""
908908
# Create or coerce a protobuf request object.
909-
# Sanity check: If we got a request object, we should *not* have
909+
# Quick check: If we got a request object, we should *not* have
910910
# gotten any keyword arguments that map to the request.
911911
has_flattened_params = any([resource])
912912
if request is not None and has_flattened_params:
@@ -1041,7 +1041,7 @@ async def get_iam_policy(
10411041
10421042
"""
10431043
# Create or coerce a protobuf request object.
1044-
# Sanity check: If we got a request object, we should *not* have
1044+
# Quick check: If we got a request object, we should *not* have
10451045
# gotten any keyword arguments that map to the request.
10461046
has_flattened_params = any([resource])
10471047
if request is not None and has_flattened_params:
@@ -1141,7 +1141,7 @@ async def test_iam_permissions(
11411141
Response message for TestIamPermissions method.
11421142
"""
11431143
# Create or coerce a protobuf request object.
1144-
# Sanity check: If we got a request object, we should *not* have
1144+
# Quick check: If we got a request object, we should *not* have
11451145
# gotten any keyword arguments that map to the request.
11461146
has_flattened_params = any([resource, permissions])
11471147
if request is not None and has_flattened_params:
@@ -1250,7 +1250,7 @@ async def create_backup(
12501250
12511251
"""
12521252
# Create or coerce a protobuf request object.
1253-
# Sanity check: If we got a request object, we should *not* have
1253+
# Quick check: If we got a request object, we should *not* have
12541254
# gotten any keyword arguments that map to the request.
12551255
has_flattened_params = any([parent, backup, backup_id])
12561256
if request is not None and has_flattened_params:
@@ -1332,7 +1332,7 @@ async def get_backup(
13321332
A backup of a Cloud Spanner database.
13331333
"""
13341334
# Create or coerce a protobuf request object.
1335-
# Sanity check: If we got a request object, we should *not* have
1335+
# Quick check: If we got a request object, we should *not* have
13361336
# gotten any keyword arguments that map to the request.
13371337
has_flattened_params = any([name])
13381338
if request is not None and has_flattened_params:
@@ -1429,7 +1429,7 @@ async def update_backup(
14291429
A backup of a Cloud Spanner database.
14301430
"""
14311431
# Create or coerce a protobuf request object.
1432-
# Sanity check: If we got a request object, we should *not* have
1432+
# Quick check: If we got a request object, we should *not* have
14331433
# gotten any keyword arguments that map to the request.
14341434
has_flattened_params = any([backup, update_mask])
14351435
if request is not None and has_flattened_params:
@@ -1510,7 +1510,7 @@ async def delete_backup(
15101510
sent along with the request as metadata.
15111511
"""
15121512
# Create or coerce a protobuf request object.
1513-
# Sanity check: If we got a request object, we should *not* have
1513+
# Quick check: If we got a request object, we should *not* have
15141514
# gotten any keyword arguments that map to the request.
15151515
has_flattened_params = any([name])
15161516
if request is not None and has_flattened_params:
@@ -1595,7 +1595,7 @@ async def list_backups(
15951595
15961596
"""
15971597
# Create or coerce a protobuf request object.
1598-
# Sanity check: If we got a request object, we should *not* have
1598+
# Quick check: If we got a request object, we should *not* have
15991599
# gotten any keyword arguments that map to the request.
16001600
has_flattened_params = any([parent])
16011601
if request is not None and has_flattened_params:
@@ -1726,7 +1726,7 @@ async def restore_database(
17261726
17271727
"""
17281728
# Create or coerce a protobuf request object.
1729-
# Sanity check: If we got a request object, we should *not* have
1729+
# Quick check: If we got a request object, we should *not* have
17301730
# gotten any keyword arguments that map to the request.
17311731
has_flattened_params = any([parent, database_id, backup])
17321732
if request is not None and has_flattened_params:
@@ -1824,7 +1824,7 @@ async def list_database_operations(
18241824
18251825
"""
18261826
# Create or coerce a protobuf request object.
1827-
# Sanity check: If we got a request object, we should *not* have
1827+
# Quick check: If we got a request object, we should *not* have
18281828
# gotten any keyword arguments that map to the request.
18291829
has_flattened_params = any([parent])
18301830
if request is not None and has_flattened_params:
@@ -1926,7 +1926,7 @@ async def list_backup_operations(
19261926
19271927
"""
19281928
# Create or coerce a protobuf request object.
1929-
# Sanity check: If we got a request object, we should *not* have
1929+
# Quick check: If we got a request object, we should *not* have
19301930
# gotten any keyword arguments that map to the request.
19311931
has_flattened_params = any([parent])
19321932
if request is not None and has_flattened_params:

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

+17-17
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def list_databases(
549549
550550
"""
551551
# Create or coerce a protobuf request object.
552-
# Sanity check: If we got a request object, we should *not* have
552+
# Quick check: If we got a request object, we should *not* have
553553
# gotten any keyword arguments that map to the request.
554554
has_flattened_params = any([parent])
555555
if request is not None and has_flattened_params:
@@ -652,7 +652,7 @@ def create_database(
652652
653653
"""
654654
# Create or coerce a protobuf request object.
655-
# Sanity check: If we got a request object, we should *not* have
655+
# Quick check: If we got a request object, we should *not* have
656656
# gotten any keyword arguments that map to the request.
657657
has_flattened_params = any([parent, create_statement])
658658
if request is not None and has_flattened_params:
@@ -732,7 +732,7 @@ def get_database(
732732
A Cloud Spanner database.
733733
"""
734734
# Create or coerce a protobuf request object.
735-
# Sanity check: If we got a request object, we should *not* have
735+
# Quick check: If we got a request object, we should *not* have
736736
# gotten any keyword arguments that map to the request.
737737
has_flattened_params = any([name])
738738
if request is not None and has_flattened_params:
@@ -847,7 +847,7 @@ def update_database_ddl(
847847
848848
"""
849849
# Create or coerce a protobuf request object.
850-
# Sanity check: If we got a request object, we should *not* have
850+
# Quick check: If we got a request object, we should *not* have
851851
# gotten any keyword arguments that map to the request.
852852
has_flattened_params = any([database, statements])
853853
if request is not None and has_flattened_params:
@@ -923,7 +923,7 @@ def drop_database(
923923
sent along with the request as metadata.
924924
"""
925925
# Create or coerce a protobuf request object.
926-
# Sanity check: If we got a request object, we should *not* have
926+
# Quick check: If we got a request object, we should *not* have
927927
# gotten any keyword arguments that map to the request.
928928
has_flattened_params = any([database])
929929
if request is not None and has_flattened_params:
@@ -997,7 +997,7 @@ def get_database_ddl(
997997
998998
"""
999999
# Create or coerce a protobuf request object.
1000-
# Sanity check: If we got a request object, we should *not* have
1000+
# Quick check: If we got a request object, we should *not* have
10011001
# gotten any keyword arguments that map to the request.
10021002
has_flattened_params = any([database])
10031003
if request is not None and has_flattened_params:
@@ -1131,7 +1131,7 @@ def set_iam_policy(
11311131
11321132
"""
11331133
# Create or coerce a protobuf request object.
1134-
# Sanity check: If we got a request object, we should *not* have
1134+
# Quick check: If we got a request object, we should *not* have
11351135
# gotten any keyword arguments that map to the request.
11361136
has_flattened_params = any([resource])
11371137
if request is not None and has_flattened_params:
@@ -1265,7 +1265,7 @@ def get_iam_policy(
12651265
12661266
"""
12671267
# Create or coerce a protobuf request object.
1268-
# Sanity check: If we got a request object, we should *not* have
1268+
# Quick check: If we got a request object, we should *not* have
12691269
# gotten any keyword arguments that map to the request.
12701270
has_flattened_params = any([resource])
12711271
if request is not None and has_flattened_params:
@@ -1354,7 +1354,7 @@ def test_iam_permissions(
13541354
Response message for TestIamPermissions method.
13551355
"""
13561356
# Create or coerce a protobuf request object.
1357-
# Sanity check: If we got a request object, we should *not* have
1357+
# Quick check: If we got a request object, we should *not* have
13581358
# gotten any keyword arguments that map to the request.
13591359
has_flattened_params = any([resource, permissions])
13601360
if request is not None and has_flattened_params:
@@ -1462,7 +1462,7 @@ def create_backup(
14621462
14631463
"""
14641464
# Create or coerce a protobuf request object.
1465-
# Sanity check: If we got a request object, we should *not* have
1465+
# Quick check: If we got a request object, we should *not* have
14661466
# gotten any keyword arguments that map to the request.
14671467
has_flattened_params = any([parent, backup, backup_id])
14681468
if request is not None and has_flattened_params:
@@ -1544,7 +1544,7 @@ def get_backup(
15441544
A backup of a Cloud Spanner database.
15451545
"""
15461546
# Create or coerce a protobuf request object.
1547-
# Sanity check: If we got a request object, we should *not* have
1547+
# Quick check: If we got a request object, we should *not* have
15481548
# gotten any keyword arguments that map to the request.
15491549
has_flattened_params = any([name])
15501550
if request is not None and has_flattened_params:
@@ -1631,7 +1631,7 @@ def update_backup(
16311631
A backup of a Cloud Spanner database.
16321632
"""
16331633
# Create or coerce a protobuf request object.
1634-
# Sanity check: If we got a request object, we should *not* have
1634+
# Quick check: If we got a request object, we should *not* have
16351635
# gotten any keyword arguments that map to the request.
16361636
has_flattened_params = any([backup, update_mask])
16371637
if request is not None and has_flattened_params:
@@ -1702,7 +1702,7 @@ def delete_backup(
17021702
sent along with the request as metadata.
17031703
"""
17041704
# Create or coerce a protobuf request object.
1705-
# Sanity check: If we got a request object, we should *not* have
1705+
# Quick check: If we got a request object, we should *not* have
17061706
# gotten any keyword arguments that map to the request.
17071707
has_flattened_params = any([name])
17081708
if request is not None and has_flattened_params:
@@ -1777,7 +1777,7 @@ def list_backups(
17771777
17781778
"""
17791779
# Create or coerce a protobuf request object.
1780-
# Sanity check: If we got a request object, we should *not* have
1780+
# Quick check: If we got a request object, we should *not* have
17811781
# gotten any keyword arguments that map to the request.
17821782
has_flattened_params = any([parent])
17831783
if request is not None and has_flattened_params:
@@ -1898,7 +1898,7 @@ def restore_database(
18981898
18991899
"""
19001900
# Create or coerce a protobuf request object.
1901-
# Sanity check: If we got a request object, we should *not* have
1901+
# Quick check: If we got a request object, we should *not* have
19021902
# gotten any keyword arguments that map to the request.
19031903
has_flattened_params = any([parent, database_id, backup])
19041904
if request is not None and has_flattened_params:
@@ -1996,7 +1996,7 @@ def list_database_operations(
19961996
19971997
"""
19981998
# Create or coerce a protobuf request object.
1999-
# Sanity check: If we got a request object, we should *not* have
1999+
# Quick check: If we got a request object, we should *not* have
20002000
# gotten any keyword arguments that map to the request.
20012001
has_flattened_params = any([parent])
20022002
if request is not None and has_flattened_params:
@@ -2090,7 +2090,7 @@ def list_backup_operations(
20902090
20912091
"""
20922092
# Create or coerce a protobuf request object.
2093-
# Sanity check: If we got a request object, we should *not* have
2093+
# Quick check: If we got a request object, we should *not* have
20942094
# gotten any keyword arguments that map to the request.
20952095
has_flattened_params = any([parent])
20962096
if request is not None and has_flattened_params:

google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ def __init__(
173173
if not self._grpc_channel:
174174
self._grpc_channel = type(self).create_channel(
175175
self._host,
176+
# use the credentials which are saved
176177
credentials=self._credentials,
177-
credentials_file=credentials_file,
178+
# Set ``credentials_file`` to ``None`` here as
179+
# the credentials that we saved earlier should be used.
180+
credentials_file=None,
178181
scopes=self._scopes,
179182
ssl_credentials=self._ssl_channel_credentials,
180183
quota_project_id=quota_project_id,
@@ -247,7 +250,7 @@ def operations_client(self) -> operations_v1.OperationsClient:
247250
This property caches on the instance; repeated calls return the same
248251
client.
249252
"""
250-
# Sanity check: Only create a new client if we do not already have one.
253+
# Quick check: Only create a new client if we do not already have one.
251254
if self._operations_client is None:
252255
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
253256

google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,11 @@ def __init__(
218218
if not self._grpc_channel:
219219
self._grpc_channel = type(self).create_channel(
220220
self._host,
221+
# use the credentials which are saved
221222
credentials=self._credentials,
222-
credentials_file=credentials_file,
223+
# Set ``credentials_file`` to ``None`` here as
224+
# the credentials that we saved earlier should be used.
225+
credentials_file=None,
223226
scopes=self._scopes,
224227
ssl_credentials=self._ssl_channel_credentials,
225228
quota_project_id=quota_project_id,
@@ -249,7 +252,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
249252
This property caches on the instance; repeated calls return the same
250253
client.
251254
"""
252-
# Sanity check: Only create a new client if we do not already have one.
255+
# Quick check: Only create a new client if we do not already have one.
253256
if self._operations_client is None:
254257
self._operations_client = operations_v1.OperationsAsyncClient(
255258
self.grpc_channel

0 commit comments

Comments
 (0)