Skip to content

Commit b9f037b

Browse files
chore(python): use black==22.3.0 (#383)
Source-Link: googleapis/synthtool@6fab84a Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
1 parent f6973e1 commit b9f037b

File tree

37 files changed

+4072
-1111
lines changed

37 files changed

+4072
-1111
lines changed

packages/google-cloud-dataproc/.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba
16+
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe

packages/google-cloud-dataproc/docs/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@
361361
intersphinx_mapping = {
362362
"python": ("https://python.readthedocs.org/en/latest/", None),
363363
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
364-
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
364+
"google.api_core": (
365+
"https://googleapis.dev/python/google-api-core/latest/",
366+
None,
367+
),
365368
"grpc": ("https://grpc.github.io/grpc/python/", None),
366369
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
367370
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),

packages/google-cloud-dataproc/google/cloud/dataproc_v1/services/autoscaling_policy_service/async_client.py

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ def sample_create_autoscaling_policy():
327327
)
328328

329329
# Send the request.
330-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
330+
response = await rpc(
331+
request,
332+
retry=retry,
333+
timeout=timeout,
334+
metadata=metadata,
335+
)
331336

332337
# Done; return the response.
333338
return response
@@ -440,7 +445,12 @@ def sample_update_autoscaling_policy():
440445
)
441446

442447
# Send the request.
443-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
448+
response = await rpc(
449+
request,
450+
retry=retry,
451+
timeout=timeout,
452+
metadata=metadata,
453+
)
444454

445455
# Done; return the response.
446456
return response
@@ -550,7 +560,12 @@ def sample_get_autoscaling_policy():
550560
)
551561

552562
# Send the request.
553-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
563+
response = await rpc(
564+
request,
565+
retry=retry,
566+
timeout=timeout,
567+
metadata=metadata,
568+
)
554569

555570
# Done; return the response.
556571
return response
@@ -666,12 +681,20 @@ def sample_list_autoscaling_policies():
666681
)
667682

668683
# Send the request.
669-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
684+
response = await rpc(
685+
request,
686+
retry=retry,
687+
timeout=timeout,
688+
metadata=metadata,
689+
)
670690

671691
# This method is paged; wrap the response in a pager, which provides
672692
# an `__aiter__` convenience method.
673693
response = pagers.ListAutoscalingPoliciesAsyncPager(
674-
method=rpc, request=request, response=response, metadata=metadata,
694+
method=rpc,
695+
request=request,
696+
response=response,
697+
metadata=metadata,
675698
)
676699

677700
# Done; return the response.
@@ -773,7 +796,10 @@ def sample_delete_autoscaling_policy():
773796

774797
# Send the request.
775798
await rpc(
776-
request, retry=retry, timeout=timeout, metadata=metadata,
799+
request,
800+
retry=retry,
801+
timeout=timeout,
802+
metadata=metadata,
777803
)
778804

779805
async def __aenter__(self):
@@ -785,7 +811,9 @@ async def __aexit__(self, exc_type, exc, tb):
785811

786812
try:
787813
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
788-
gapic_version=pkg_resources.get_distribution("google-cloud-dataproc",).version,
814+
gapic_version=pkg_resources.get_distribution(
815+
"google-cloud-dataproc",
816+
).version,
789817
)
790818
except pkg_resources.DistributionNotFound:
791819
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-dataproc/google/cloud/dataproc_v1/services/autoscaling_policy_service/client.py

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class AutoscalingPolicyServiceClientMeta(type):
5656
_transport_registry["grpc_asyncio"] = AutoscalingPolicyServiceGrpcAsyncIOTransport
5757

5858
def get_transport_class(
59-
cls, label: str = None,
59+
cls,
60+
label: str = None,
6061
) -> Type[AutoscalingPolicyServiceTransport]:
6162
"""Returns an appropriate transport class.
6263
@@ -165,11 +166,15 @@ def transport(self) -> AutoscalingPolicyServiceTransport:
165166

166167
@staticmethod
167168
def autoscaling_policy_path(
168-
project: str, location: str, autoscaling_policy: str,
169+
project: str,
170+
location: str,
171+
autoscaling_policy: str,
169172
) -> str:
170173
"""Returns a fully-qualified autoscaling_policy string."""
171174
return "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}".format(
172-
project=project, location=location, autoscaling_policy=autoscaling_policy,
175+
project=project,
176+
location=location,
177+
autoscaling_policy=autoscaling_policy,
173178
)
174179

175180
@staticmethod
@@ -182,7 +187,9 @@ def parse_autoscaling_policy_path(path: str) -> Dict[str, str]:
182187
return m.groupdict() if m else {}
183188

184189
@staticmethod
185-
def common_billing_account_path(billing_account: str,) -> str:
190+
def common_billing_account_path(
191+
billing_account: str,
192+
) -> str:
186193
"""Returns a fully-qualified billing_account string."""
187194
return "billingAccounts/{billing_account}".format(
188195
billing_account=billing_account,
@@ -195,9 +202,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
195202
return m.groupdict() if m else {}
196203

197204
@staticmethod
198-
def common_folder_path(folder: str,) -> str:
205+
def common_folder_path(
206+
folder: str,
207+
) -> str:
199208
"""Returns a fully-qualified folder string."""
200-
return "folders/{folder}".format(folder=folder,)
209+
return "folders/{folder}".format(
210+
folder=folder,
211+
)
201212

202213
@staticmethod
203214
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -206,9 +217,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
206217
return m.groupdict() if m else {}
207218

208219
@staticmethod
209-
def common_organization_path(organization: str,) -> str:
220+
def common_organization_path(
221+
organization: str,
222+
) -> str:
210223
"""Returns a fully-qualified organization string."""
211-
return "organizations/{organization}".format(organization=organization,)
224+
return "organizations/{organization}".format(
225+
organization=organization,
226+
)
212227

213228
@staticmethod
214229
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -217,9 +232,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
217232
return m.groupdict() if m else {}
218233

219234
@staticmethod
220-
def common_project_path(project: str,) -> str:
235+
def common_project_path(
236+
project: str,
237+
) -> str:
221238
"""Returns a fully-qualified project string."""
222-
return "projects/{project}".format(project=project,)
239+
return "projects/{project}".format(
240+
project=project,
241+
)
223242

224243
@staticmethod
225244
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -228,10 +247,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
228247
return m.groupdict() if m else {}
229248

230249
@staticmethod
231-
def common_location_path(project: str, location: str,) -> str:
250+
def common_location_path(
251+
project: str,
252+
location: str,
253+
) -> str:
232254
"""Returns a fully-qualified location string."""
233255
return "projects/{project}/locations/{location}".format(
234-
project=project, location=location,
256+
project=project,
257+
location=location,
235258
)
236259

237260
@staticmethod
@@ -521,7 +544,12 @@ def sample_create_autoscaling_policy():
521544
)
522545

523546
# Send the request.
524-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
547+
response = rpc(
548+
request,
549+
retry=retry,
550+
timeout=timeout,
551+
metadata=metadata,
552+
)
525553

526554
# Done; return the response.
527555
return response
@@ -626,7 +654,12 @@ def sample_update_autoscaling_policy():
626654
)
627655

628656
# Send the request.
629-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
657+
response = rpc(
658+
request,
659+
retry=retry,
660+
timeout=timeout,
661+
metadata=metadata,
662+
)
630663

631664
# Done; return the response.
632665
return response
@@ -726,7 +759,12 @@ def sample_get_autoscaling_policy():
726759
)
727760

728761
# Send the request.
729-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
762+
response = rpc(
763+
request,
764+
retry=retry,
765+
timeout=timeout,
766+
metadata=metadata,
767+
)
730768

731769
# Done; return the response.
732770
return response
@@ -834,12 +872,20 @@ def sample_list_autoscaling_policies():
834872
)
835873

836874
# Send the request.
837-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
875+
response = rpc(
876+
request,
877+
retry=retry,
878+
timeout=timeout,
879+
metadata=metadata,
880+
)
838881

839882
# This method is paged; wrap the response in a pager, which provides
840883
# an `__iter__` convenience method.
841884
response = pagers.ListAutoscalingPoliciesPager(
842-
method=rpc, request=request, response=response, metadata=metadata,
885+
method=rpc,
886+
request=request,
887+
response=response,
888+
metadata=metadata,
843889
)
844890

845891
# Done; return the response.
@@ -943,7 +989,10 @@ def sample_delete_autoscaling_policy():
943989

944990
# Send the request.
945991
rpc(
946-
request, retry=retry, timeout=timeout, metadata=metadata,
992+
request,
993+
retry=retry,
994+
timeout=timeout,
995+
metadata=metadata,
947996
)
948997

949998
def __enter__(self):
@@ -962,7 +1011,9 @@ def __exit__(self, type, value, traceback):
9621011

9631012
try:
9641013
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
965-
gapic_version=pkg_resources.get_distribution("google-cloud-dataproc",).version,
1014+
gapic_version=pkg_resources.get_distribution(
1015+
"google-cloud-dataproc",
1016+
).version,
9661017
)
9671018
except pkg_resources.DistributionNotFound:
9681019
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

packages/google-cloud-dataproc/google/cloud/dataproc_v1/services/autoscaling_policy_service/transports/base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030

3131
try:
3232
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
33-
gapic_version=pkg_resources.get_distribution("google-cloud-dataproc",).version,
33+
gapic_version=pkg_resources.get_distribution(
34+
"google-cloud-dataproc",
35+
).version,
3436
)
3537
except pkg_resources.DistributionNotFound:
3638
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
@@ -179,9 +181,9 @@ def _prep_wrapped_messages(self, client_info):
179181
def close(self):
180182
"""Closes resources associated with the transport.
181183
182-
.. warning::
183-
Only call this method if the transport is NOT shared
184-
with other clients - this may cause errors in other clients!
184+
.. warning::
185+
Only call this method if the transport is NOT shared
186+
with other clients - this may cause errors in other clients!
185187
"""
186188
raise NotImplementedError()
187189

packages/google-cloud-dataproc/google/cloud/dataproc_v1/services/autoscaling_policy_service/transports/grpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ def create_channel(
226226

227227
@property
228228
def grpc_channel(self) -> grpc.Channel:
229-
"""Return the channel designed to connect to this service.
230-
"""
229+
"""Return the channel designed to connect to this service."""
231230
return self._grpc_channel
232231

233232
@property

0 commit comments

Comments
 (0)