Skip to content

Commit 39ff137

Browse files
fix: resolve DuplicateCredentialArgs error when using credentials_file (#676)
committer: parthea PiperOrigin-RevId: 425964861 Source-Link: googleapis/googleapis@84b1a5a Source-Link: googleapis/googleapis-gen@4fb761b 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 819be92 commit 39ff137

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ async def list_databases(
270270
271271
"""
272272
# Create or coerce a protobuf request object.
273-
# Sanity check: If we got a request object, we should *not* have
273+
# Quick check: If we got a request object, we should *not* have
274274
# gotten any keyword arguments that map to the request.
275275
has_flattened_params = any([parent])
276276
if request is not None and has_flattened_params:
@@ -383,7 +383,7 @@ async def create_database(
383383
384384
"""
385385
# Create or coerce a protobuf request object.
386-
# Sanity check: If we got a request object, we should *not* have
386+
# Quick check: If we got a request object, we should *not* have
387387
# gotten any keyword arguments that map to the request.
388388
has_flattened_params = any([parent, create_statement])
389389
if request is not None and has_flattened_params:
@@ -463,7 +463,7 @@ async def get_database(
463463
A Cloud Spanner database.
464464
"""
465465
# Create or coerce a protobuf request object.
466-
# Sanity check: If we got a request object, we should *not* have
466+
# Quick check: If we got a request object, we should *not* have
467467
# gotten any keyword arguments that map to the request.
468468
has_flattened_params = any([name])
469469
if request is not None and has_flattened_params:
@@ -588,7 +588,7 @@ async def update_database_ddl(
588588
589589
"""
590590
# Create or coerce a protobuf request object.
591-
# Sanity check: If we got a request object, we should *not* have
591+
# Quick check: If we got a request object, we should *not* have
592592
# gotten any keyword arguments that map to the request.
593593
has_flattened_params = any([database, statements])
594594
if request is not None and has_flattened_params:
@@ -674,7 +674,7 @@ async def drop_database(
674674
sent along with the request as metadata.
675675
"""
676676
# Create or coerce a protobuf request object.
677-
# Sanity check: If we got a request object, we should *not* have
677+
# Quick check: If we got a request object, we should *not* have
678678
# gotten any keyword arguments that map to the request.
679679
has_flattened_params = any([database])
680680
if request is not None and has_flattened_params:
@@ -758,7 +758,7 @@ async def get_database_ddl(
758758
759759
"""
760760
# Create or coerce a protobuf request object.
761-
# Sanity check: If we got a request object, we should *not* have
761+
# Quick check: If we got a request object, we should *not* have
762762
# gotten any keyword arguments that map to the request.
763763
has_flattened_params = any([database])
764764
if request is not None and has_flattened_params:
@@ -902,7 +902,7 @@ async def set_iam_policy(
902902
903903
"""
904904
# Create or coerce a protobuf request object.
905-
# Sanity check: If we got a request object, we should *not* have
905+
# Quick check: If we got a request object, we should *not* have
906906
# gotten any keyword arguments that map to the request.
907907
has_flattened_params = any([resource])
908908
if request is not None and has_flattened_params:
@@ -1037,7 +1037,7 @@ async def get_iam_policy(
10371037
10381038
"""
10391039
# Create or coerce a protobuf request object.
1040-
# Sanity check: If we got a request object, we should *not* have
1040+
# Quick check: If we got a request object, we should *not* have
10411041
# gotten any keyword arguments that map to the request.
10421042
has_flattened_params = any([resource])
10431043
if request is not None and has_flattened_params:
@@ -1137,7 +1137,7 @@ async def test_iam_permissions(
11371137
Response message for TestIamPermissions method.
11381138
"""
11391139
# Create or coerce a protobuf request object.
1140-
# Sanity check: If we got a request object, we should *not* have
1140+
# Quick check: If we got a request object, we should *not* have
11411141
# gotten any keyword arguments that map to the request.
11421142
has_flattened_params = any([resource, permissions])
11431143
if request is not None and has_flattened_params:
@@ -1246,7 +1246,7 @@ async def create_backup(
12461246
12471247
"""
12481248
# Create or coerce a protobuf request object.
1249-
# Sanity check: If we got a request object, we should *not* have
1249+
# Quick check: If we got a request object, we should *not* have
12501250
# gotten any keyword arguments that map to the request.
12511251
has_flattened_params = any([parent, backup, backup_id])
12521252
if request is not None and has_flattened_params:
@@ -1328,7 +1328,7 @@ async def get_backup(
13281328
A backup of a Cloud Spanner database.
13291329
"""
13301330
# Create or coerce a protobuf request object.
1331-
# Sanity check: If we got a request object, we should *not* have
1331+
# Quick check: If we got a request object, we should *not* have
13321332
# gotten any keyword arguments that map to the request.
13331333
has_flattened_params = any([name])
13341334
if request is not None and has_flattened_params:
@@ -1425,7 +1425,7 @@ async def update_backup(
14251425
A backup of a Cloud Spanner database.
14261426
"""
14271427
# Create or coerce a protobuf request object.
1428-
# Sanity check: If we got a request object, we should *not* have
1428+
# Quick check: If we got a request object, we should *not* have
14291429
# gotten any keyword arguments that map to the request.
14301430
has_flattened_params = any([backup, update_mask])
14311431
if request is not None and has_flattened_params:
@@ -1506,7 +1506,7 @@ async def delete_backup(
15061506
sent along with the request as metadata.
15071507
"""
15081508
# Create or coerce a protobuf request object.
1509-
# Sanity check: If we got a request object, we should *not* have
1509+
# Quick check: If we got a request object, we should *not* have
15101510
# gotten any keyword arguments that map to the request.
15111511
has_flattened_params = any([name])
15121512
if request is not None and has_flattened_params:
@@ -1591,7 +1591,7 @@ async def list_backups(
15911591
15921592
"""
15931593
# Create or coerce a protobuf request object.
1594-
# Sanity check: If we got a request object, we should *not* have
1594+
# Quick check: If we got a request object, we should *not* have
15951595
# gotten any keyword arguments that map to the request.
15961596
has_flattened_params = any([parent])
15971597
if request is not None and has_flattened_params:
@@ -1722,7 +1722,7 @@ async def restore_database(
17221722
17231723
"""
17241724
# Create or coerce a protobuf request object.
1725-
# Sanity check: If we got a request object, we should *not* have
1725+
# Quick check: If we got a request object, we should *not* have
17261726
# gotten any keyword arguments that map to the request.
17271727
has_flattened_params = any([parent, database_id, backup])
17281728
if request is not None and has_flattened_params:
@@ -1820,7 +1820,7 @@ async def list_database_operations(
18201820
18211821
"""
18221822
# Create or coerce a protobuf request object.
1823-
# Sanity check: If we got a request object, we should *not* have
1823+
# Quick check: If we got a request object, we should *not* have
18241824
# gotten any keyword arguments that map to the request.
18251825
has_flattened_params = any([parent])
18261826
if request is not None and has_flattened_params:
@@ -1922,7 +1922,7 @@ async def list_backup_operations(
19221922
19231923
"""
19241924
# Create or coerce a protobuf request object.
1925-
# Sanity check: If we got a request object, we should *not* have
1925+
# Quick check: If we got a request object, we should *not* have
19261926
# gotten any keyword arguments that map to the request.
19271927
has_flattened_params = any([parent])
19281928
if request is not None and has_flattened_params:

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def list_databases(
531531
532532
"""
533533
# Create or coerce a protobuf request object.
534-
# Sanity check: If we got a request object, we should *not* have
534+
# Quick check: If we got a request object, we should *not* have
535535
# gotten any keyword arguments that map to the request.
536536
has_flattened_params = any([parent])
537537
if request is not None and has_flattened_params:
@@ -634,7 +634,7 @@ def create_database(
634634
635635
"""
636636
# Create or coerce a protobuf request object.
637-
# Sanity check: If we got a request object, we should *not* have
637+
# Quick check: If we got a request object, we should *not* have
638638
# gotten any keyword arguments that map to the request.
639639
has_flattened_params = any([parent, create_statement])
640640
if request is not None and has_flattened_params:
@@ -714,7 +714,7 @@ def get_database(
714714
A Cloud Spanner database.
715715
"""
716716
# Create or coerce a protobuf request object.
717-
# Sanity check: If we got a request object, we should *not* have
717+
# Quick check: If we got a request object, we should *not* have
718718
# gotten any keyword arguments that map to the request.
719719
has_flattened_params = any([name])
720720
if request is not None and has_flattened_params:
@@ -829,7 +829,7 @@ def update_database_ddl(
829829
830830
"""
831831
# Create or coerce a protobuf request object.
832-
# Sanity check: If we got a request object, we should *not* have
832+
# Quick check: If we got a request object, we should *not* have
833833
# gotten any keyword arguments that map to the request.
834834
has_flattened_params = any([database, statements])
835835
if request is not None and has_flattened_params:
@@ -905,7 +905,7 @@ def drop_database(
905905
sent along with the request as metadata.
906906
"""
907907
# Create or coerce a protobuf request object.
908-
# Sanity check: If we got a request object, we should *not* have
908+
# Quick check: If we got a request object, we should *not* have
909909
# gotten any keyword arguments that map to the request.
910910
has_flattened_params = any([database])
911911
if request is not None and has_flattened_params:
@@ -979,7 +979,7 @@ def get_database_ddl(
979979
980980
"""
981981
# Create or coerce a protobuf request object.
982-
# Sanity check: If we got a request object, we should *not* have
982+
# Quick check: If we got a request object, we should *not* have
983983
# gotten any keyword arguments that map to the request.
984984
has_flattened_params = any([database])
985985
if request is not None and has_flattened_params:
@@ -1113,7 +1113,7 @@ def set_iam_policy(
11131113
11141114
"""
11151115
# Create or coerce a protobuf request object.
1116-
# Sanity check: If we got a request object, we should *not* have
1116+
# Quick check: If we got a request object, we should *not* have
11171117
# gotten any keyword arguments that map to the request.
11181118
has_flattened_params = any([resource])
11191119
if request is not None and has_flattened_params:
@@ -1247,7 +1247,7 @@ def get_iam_policy(
12471247
12481248
"""
12491249
# Create or coerce a protobuf request object.
1250-
# Sanity check: If we got a request object, we should *not* have
1250+
# Quick check: If we got a request object, we should *not* have
12511251
# gotten any keyword arguments that map to the request.
12521252
has_flattened_params = any([resource])
12531253
if request is not None and has_flattened_params:
@@ -1336,7 +1336,7 @@ def test_iam_permissions(
13361336
Response message for TestIamPermissions method.
13371337
"""
13381338
# Create or coerce a protobuf request object.
1339-
# Sanity check: If we got a request object, we should *not* have
1339+
# Quick check: If we got a request object, we should *not* have
13401340
# gotten any keyword arguments that map to the request.
13411341
has_flattened_params = any([resource, permissions])
13421342
if request is not None and has_flattened_params:
@@ -1444,7 +1444,7 @@ def create_backup(
14441444
14451445
"""
14461446
# Create or coerce a protobuf request object.
1447-
# Sanity check: If we got a request object, we should *not* have
1447+
# Quick check: If we got a request object, we should *not* have
14481448
# gotten any keyword arguments that map to the request.
14491449
has_flattened_params = any([parent, backup, backup_id])
14501450
if request is not None and has_flattened_params:
@@ -1526,7 +1526,7 @@ def get_backup(
15261526
A backup of a Cloud Spanner database.
15271527
"""
15281528
# Create or coerce a protobuf request object.
1529-
# Sanity check: If we got a request object, we should *not* have
1529+
# Quick check: If we got a request object, we should *not* have
15301530
# gotten any keyword arguments that map to the request.
15311531
has_flattened_params = any([name])
15321532
if request is not None and has_flattened_params:
@@ -1613,7 +1613,7 @@ def update_backup(
16131613
A backup of a Cloud Spanner database.
16141614
"""
16151615
# Create or coerce a protobuf request object.
1616-
# Sanity check: If we got a request object, we should *not* have
1616+
# Quick check: If we got a request object, we should *not* have
16171617
# gotten any keyword arguments that map to the request.
16181618
has_flattened_params = any([backup, update_mask])
16191619
if request is not None and has_flattened_params:
@@ -1684,7 +1684,7 @@ def delete_backup(
16841684
sent along with the request as metadata.
16851685
"""
16861686
# Create or coerce a protobuf request object.
1687-
# Sanity check: If we got a request object, we should *not* have
1687+
# Quick check: If we got a request object, we should *not* have
16881688
# gotten any keyword arguments that map to the request.
16891689
has_flattened_params = any([name])
16901690
if request is not None and has_flattened_params:
@@ -1759,7 +1759,7 @@ def list_backups(
17591759
17601760
"""
17611761
# Create or coerce a protobuf request object.
1762-
# Sanity check: If we got a request object, we should *not* have
1762+
# Quick check: If we got a request object, we should *not* have
17631763
# gotten any keyword arguments that map to the request.
17641764
has_flattened_params = any([parent])
17651765
if request is not None and has_flattened_params:
@@ -1880,7 +1880,7 @@ def restore_database(
18801880
18811881
"""
18821882
# Create or coerce a protobuf request object.
1883-
# Sanity check: If we got a request object, we should *not* have
1883+
# Quick check: If we got a request object, we should *not* have
18841884
# gotten any keyword arguments that map to the request.
18851885
has_flattened_params = any([parent, database_id, backup])
18861886
if request is not None and has_flattened_params:
@@ -1978,7 +1978,7 @@ def list_database_operations(
19781978
19791979
"""
19801980
# Create or coerce a protobuf request object.
1981-
# Sanity check: If we got a request object, we should *not* have
1981+
# Quick check: If we got a request object, we should *not* have
19821982
# gotten any keyword arguments that map to the request.
19831983
has_flattened_params = any([parent])
19841984
if request is not None and has_flattened_params:
@@ -2072,7 +2072,7 @@ def list_backup_operations(
20722072
20732073
"""
20742074
# Create or coerce a protobuf request object.
2075-
# Sanity check: If we got a request object, we should *not* have
2075+
# Quick check: If we got a request object, we should *not* have
20762076
# gotten any keyword arguments that map to the request.
20772077
has_flattened_params = any([parent])
20782078
if request is not None and has_flattened_params:

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

Lines changed: 5 additions & 2 deletions
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

Lines changed: 5 additions & 2 deletions
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)