Skip to content

Commit 46bf4a2

Browse files
committed
Add missing request builder
1 parent 3c5a3f4 commit 46bf4a2

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

dask_cloudprovider/gcp/instances.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,11 @@ def __init__(
629629
"gpu_instance": self.gpu_instance,
630630
"bootstrap": self.bootstrap,
631631
"auto_shutdown": self.auto_shutdown,
632-
"preemptible": preemptible
633-
if preemptible is not None
634-
else self.config.get("preemptible"),
632+
"preemptible": (
633+
preemptible
634+
if preemptible is not None
635+
else self.config.get("preemptible")
636+
),
635637
"instance_labels": instance_labels or self.config.get("instance_labels"),
636638
"service_account": service_account or self.config.get("service_account"),
637639
}
@@ -662,16 +664,23 @@ def refresh_client(self):
662664
if self.service_account_credentials:
663665
import google.oauth2.service_account # google-auth
664666

665-
credentials = google.oauth2.service_account.Credentials.from_service_account_info(
666-
self.service_account_credentials,
667-
scopes=["https://www.googleapis.com/auth/cloud-platform"],
667+
credentials = (
668+
google.oauth2.service_account.Credentials.from_service_account_info(
669+
self.service_account_credentials,
670+
scopes=["https://www.googleapis.com/auth/cloud-platform"],
671+
)
668672
)
669673
else:
670674
# Obtain Application Default Credentials
671675
credentials, _ = google.auth.default()
672676

673677
# Use the credentials to build a service client
674-
return googleapiclient.discovery.build("compute", "v1", credentials=credentials)
678+
return googleapiclient.discovery.build(
679+
"compute",
680+
"v1",
681+
credentials=credentials,
682+
requestBuilder=build_request(credentials),
683+
)
675684

676685
def instances(self):
677686
try:

0 commit comments

Comments
 (0)