Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8f8ee78

Browse files
fix: only add quota project id if supported (#75)
1 parent6229317 commit8f8ee78

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

‎google/api_core/grpc_helpers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def _create_composite_credentials(
216216
else:
217217
credentials,_=google.auth.default(scopes=scopes)
218218

219-
ifquota_project_id:
219+
ifquota_project_idandisinstance(credentials,google.auth.credentials.CredentialsWithQuotaProject):
220220
credentials=credentials.with_quota_project(quota_project_id)
221221

222222
request=google.auth.transport.requests.Request()

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
dependencies= [
3232
"googleapis-common-protos >= 1.6.0, < 2.0dev",
3333
"protobuf >= 3.12.0",
34-
"google-auth >= 1.19.1, < 2.0dev",
34+
"google-auth >= 1.21.1, < 2.0dev",
3535
"requests >= 2.18.0, < 3.0.0dev",
3636
"setuptools >= 34.0.0",
3737
"six >= 1.10.0",

‎tests/asyncio/test_grpc_helpers_async.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def test_create_channel_explicit_with_quota_project(grpc_secure_channel, composi
369369
target="example.com:443"
370370
composite_creds=composite_creds_call.return_value
371371

372-
credentials=mock.create_autospec(google.auth.credentials.Credentials,instance=True)
372+
credentials=mock.create_autospec(google.auth.credentials.CredentialsWithQuotaProject,instance=True)
373373

374374
channel=grpc_helpers_async.create_channel(
375375
target,credentials=credentials,quota_project_id="project-foo"

‎tests/unit/test_grpc_helpers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def test_create_channel_explicit_with_quota_project(grpc_secure_channel, composi
341341
target="example.com:443"
342342
composite_creds=composite_creds_call.return_value
343343

344-
credentials=mock.create_autospec(google.auth.credentials.Credentials,instance=True)
344+
credentials=mock.create_autospec(google.auth.credentials.CredentialsWithQuotaProject,instance=True)
345345

346346
channel=grpc_helpers.create_channel(
347347
target,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp