diff --git a/dask_cloudprovider/gcp/instances.py b/dask_cloudprovider/gcp/instances.py index 5ad1b425..8369788d 100644 --- a/dask_cloudprovider/gcp/instances.py +++ b/dask_cloudprovider/gcp/instances.py @@ -629,9 +629,11 @@ def __init__( "gpu_instance": self.gpu_instance, "bootstrap": self.bootstrap, "auto_shutdown": self.auto_shutdown, - "preemptible": preemptible - if preemptible is not None - else self.config.get("preemptible"), + "preemptible": ( + preemptible + if preemptible is not None + else self.config.get("preemptible") + ), "instance_labels": instance_labels or self.config.get("instance_labels"), "service_account": service_account or self.config.get("service_account"), } @@ -671,7 +673,12 @@ def refresh_client(self): credentials, _ = google.auth.default() # Use the credentials to build a service client - return googleapiclient.discovery.build("compute", "v1", credentials=credentials) + return googleapiclient.discovery.build( + "compute", + "v1", + credentials=credentials, + requestBuilder=build_request(credentials), + ) def instances(self): try: