FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: only add quota project id if supported by arithmetic1728 · Pull Request #75 · googleapis/python-api-core · GitHub

This repository was archived by the owner on Feb 23, 2026. It is now read-only.
/ python-api-core Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (4) All 1 file type selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion google/api_core/grpc_helpers.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _create_composite_credentials(
else:
credentials, _ = google.auth.default(scopes=scopes)

if quota_project_id:
if quota_project_id and isinstance(credentials, google.auth.credentials.CredentialsWithQuotaProject):
credentials = credentials.with_quota_project(quota_project_id)

request = google.auth.transport.requests.Request()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
dependencies = [
"googleapis-common-protos >= 1.6.0, < 2.0dev",
"protobuf >= 3.12.0",
"google-auth >= 1.19.1, < 2.0dev",
"google-auth >= 1.21.1, < 2.0dev",
"requests >= 2.18.0, < 3.0.0dev",
"setuptools >= 34.0.0",
"six >= 1.10.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/test_grpc_helpers_async.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def test_create_channel_explicit_with_quota_project(grpc_secure_channel, composi
target = "example.com:443"
composite_creds = composite_creds_call.return_value

credentials = mock.create_autospec(google.auth.credentials.Credentials, instance=True)
credentials = mock.create_autospec(google.auth.credentials.CredentialsWithQuotaProject, instance=True)

channel = grpc_helpers_async.create_channel(
target, credentials=credentials, quota_project_id="project-foo"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_grpc_helpers.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_create_channel_explicit_with_quota_project(grpc_secure_channel, composi
target = "example.com:443"
composite_creds = composite_creds_call.return_value

credentials = mock.create_autospec(google.auth.credentials.Credentials, instance=True)
credentials = mock.create_autospec(google.auth.credentials.CredentialsWithQuotaProject, instance=True)

channel = grpc_helpers.create_channel(
target,
Expand Down

Back | FazBrowse Home | New Git URL