Skip to content

Commit c403e7b

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

File tree

26 files changed

+975
-334
lines changed

26 files changed

+975
-334
lines changed

packages/google-cloud-error-reporting/.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:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3
16+
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe

packages/google-cloud-error-reporting/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-error-reporting/google/cloud/error_reporting/_gapic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ def report_error_event(self, error_report):
6666
# Since error_report uses camel case for key names (like serviceContext),
6767
# but ReportedErrorEvent uses snake case for key names (like service_context),
6868
# we need to route throught json.
69-
error_report_payload = google.cloud.errorreporting_v1beta1.ReportedErrorEvent.from_json(
70-
json.dumps(error_report)
69+
error_report_payload = (
70+
google.cloud.errorreporting_v1beta1.ReportedErrorEvent.from_json(
71+
json.dumps(error_report)
72+
)
7173
)
7274

7375
self._gapic_api.report_error_event(

packages/google-cloud-error-reporting/google/cloud/error_reporting/client.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _build_error_report(
246246
:rtype: dict
247247
:returns: A dict payload ready to be serialized to JSON and sent to
248248
the API.
249-
"""
249+
"""
250250
payload = {
251251
"serviceContext": {"service": self.service},
252252
"message": "{0}".format(message),
@@ -315,7 +315,7 @@ def _send_error_report(
315315
self.report_errors_api.report_error_event(error_report)
316316

317317
def report(self, message, http_context=None, user=None):
318-
""" Reports a message to Error Reporting
318+
"""Reports a message to Error Reporting
319319
320320
https://cloud.google.com/error-reporting/docs/formatting-error-messages
321321
@@ -360,27 +360,27 @@ def report(self, message, http_context=None, user=None):
360360
)
361361

362362
def report_exception(self, http_context=None, user=None):
363-
""" Reports the details of the latest exceptions to Error Reporting.
364-
365-
:type http_context: :class`google.cloud.error_reporting.HTTPContext`
366-
:param http_context: The HTTP request which was processed when the
367-
error was triggered.
368-
369-
:type user: str
370-
:param user: The user who caused or was affected by the crash. This
371-
can be a user ID, an email address, or an arbitrary
372-
token that uniquely identifies the user. When sending an
373-
error report, leave this field empty if the user was
374-
not logged in. In this case the Error Reporting system
375-
will use other data, such as remote IP address,
376-
to distinguish affected users.
377-
378-
Example::
379-
380-
>>> try:
381-
>>> raise NameError
382-
>>> except Exception:
383-
>>> client.report_exception()
363+
"""Reports the details of the latest exceptions to Error Reporting.
364+
365+
:type http_context: :class`google.cloud.error_reporting.HTTPContext`
366+
:param http_context: The HTTP request which was processed when the
367+
error was triggered.
368+
369+
:type user: str
370+
:param user: The user who caused or was affected by the crash. This
371+
can be a user ID, an email address, or an arbitrary
372+
token that uniquely identifies the user. When sending an
373+
error report, leave this field empty if the user was
374+
not logged in. In this case the Error Reporting system
375+
will use other data, such as remote IP address,
376+
to distinguish affected users.
377+
378+
Example::
379+
380+
>>> try:
381+
>>> raise NameError
382+
>>> except Exception:
383+
>>> client.report_exception()
384384
"""
385385
self._send_error_report(
386386
traceback.format_exc(), http_context=http_context, user=user

packages/google-cloud-error-reporting/google/cloud/errorreporting_v1beta1/services/error_group_service/async_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,12 @@ def sample_get_group():
295295
)
296296

297297
# Send the request.
298-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
298+
response = await rpc(
299+
request,
300+
retry=retry,
301+
timeout=timeout,
302+
metadata=metadata,
303+
)
299304

300305
# Done; return the response.
301306
return response
@@ -388,7 +393,12 @@ def sample_update_group():
388393
)
389394

390395
# Send the request.
391-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
396+
response = await rpc(
397+
request,
398+
retry=retry,
399+
timeout=timeout,
400+
metadata=metadata,
401+
)
392402

393403
# Done; return the response.
394404
return response

packages/google-cloud-error-reporting/google/cloud/errorreporting_v1beta1/services/error_group_service/client.py

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class ErrorGroupServiceClientMeta(type):
5656
_transport_registry["grpc_asyncio"] = ErrorGroupServiceGrpcAsyncIOTransport
5757

5858
def get_transport_class(
59-
cls, label: str = None,
59+
cls,
60+
label: str = None,
6061
) -> Type[ErrorGroupServiceTransport]:
6162
"""Returns an appropriate transport class.
6263
@@ -162,9 +163,15 @@ def transport(self) -> ErrorGroupServiceTransport:
162163
return self._transport
163164

164165
@staticmethod
165-
def error_group_path(project: str, group: str,) -> str:
166+
def error_group_path(
167+
project: str,
168+
group: str,
169+
) -> str:
166170
"""Returns a fully-qualified error_group string."""
167-
return "projects/{project}/groups/{group}".format(project=project, group=group,)
171+
return "projects/{project}/groups/{group}".format(
172+
project=project,
173+
group=group,
174+
)
168175

169176
@staticmethod
170177
def parse_error_group_path(path: str) -> Dict[str, str]:
@@ -173,7 +180,9 @@ def parse_error_group_path(path: str) -> Dict[str, str]:
173180
return m.groupdict() if m else {}
174181

175182
@staticmethod
176-
def common_billing_account_path(billing_account: str,) -> str:
183+
def common_billing_account_path(
184+
billing_account: str,
185+
) -> str:
177186
"""Returns a fully-qualified billing_account string."""
178187
return "billingAccounts/{billing_account}".format(
179188
billing_account=billing_account,
@@ -186,9 +195,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
186195
return m.groupdict() if m else {}
187196

188197
@staticmethod
189-
def common_folder_path(folder: str,) -> str:
198+
def common_folder_path(
199+
folder: str,
200+
) -> str:
190201
"""Returns a fully-qualified folder string."""
191-
return "folders/{folder}".format(folder=folder,)
202+
return "folders/{folder}".format(
203+
folder=folder,
204+
)
192205

193206
@staticmethod
194207
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -197,9 +210,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
197210
return m.groupdict() if m else {}
198211

199212
@staticmethod
200-
def common_organization_path(organization: str,) -> str:
213+
def common_organization_path(
214+
organization: str,
215+
) -> str:
201216
"""Returns a fully-qualified organization string."""
202-
return "organizations/{organization}".format(organization=organization,)
217+
return "organizations/{organization}".format(
218+
organization=organization,
219+
)
203220

204221
@staticmethod
205222
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -208,9 +225,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
208225
return m.groupdict() if m else {}
209226

210227
@staticmethod
211-
def common_project_path(project: str,) -> str:
228+
def common_project_path(
229+
project: str,
230+
) -> str:
212231
"""Returns a fully-qualified project string."""
213-
return "projects/{project}".format(project=project,)
232+
return "projects/{project}".format(
233+
project=project,
234+
)
214235

215236
@staticmethod
216237
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -219,10 +240,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
219240
return m.groupdict() if m else {}
220241

221242
@staticmethod
222-
def common_location_path(project: str, location: str,) -> str:
243+
def common_location_path(
244+
project: str,
245+
location: str,
246+
) -> str:
223247
"""Returns a fully-qualified location string."""
224248
return "projects/{project}/locations/{location}".format(
225-
project=project, location=location,
249+
project=project,
250+
location=location,
226251
)
227252

228253
@staticmethod
@@ -487,7 +512,12 @@ def sample_get_group():
487512
)
488513

489514
# Send the request.
490-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
515+
response = rpc(
516+
request,
517+
retry=retry,
518+
timeout=timeout,
519+
metadata=metadata,
520+
)
491521

492522
# Done; return the response.
493523
return response
@@ -580,7 +610,12 @@ def sample_update_group():
580610
)
581611

582612
# Send the request.
583-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
613+
response = rpc(
614+
request,
615+
retry=retry,
616+
timeout=timeout,
617+
metadata=metadata,
618+
)
584619

585620
# Done; return the response.
586621
return response

packages/google-cloud-error-reporting/google/cloud/errorreporting_v1beta1/services/error_group_service/transports/base.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,23 @@ def _prep_wrapped_messages(self, client_info):
122122
# Precompute the wrapped methods.
123123
self._wrapped_methods = {
124124
self.get_group: gapic_v1.method.wrap_method(
125-
self.get_group, default_timeout=None, client_info=client_info,
125+
self.get_group,
126+
default_timeout=None,
127+
client_info=client_info,
126128
),
127129
self.update_group: gapic_v1.method.wrap_method(
128-
self.update_group, default_timeout=None, client_info=client_info,
130+
self.update_group,
131+
default_timeout=None,
132+
client_info=client_info,
129133
),
130134
}
131135

132136
def close(self):
133137
"""Closes resources associated with the transport.
134138
135-
.. warning::
136-
Only call this method if the transport is NOT shared
137-
with other clients - this may cause errors in other clients!
139+
.. warning::
140+
Only call this method if the transport is NOT shared
141+
with other clients - this may cause errors in other clients!
138142
"""
139143
raise NotImplementedError()
140144

packages/google-cloud-error-reporting/google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc.py

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

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

232231
@property

packages/google-cloud-error-reporting/google/cloud/errorreporting_v1beta1/services/error_stats_service/async_client.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,20 @@ def sample_list_group_stats():
320320
)
321321

322322
# Send the request.
323-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
323+
response = await rpc(
324+
request,
325+
retry=retry,
326+
timeout=timeout,
327+
metadata=metadata,
328+
)
324329

325330
# This method is paged; wrap the response in a pager, which provides
326331
# an `__aiter__` convenience method.
327332
response = pagers.ListGroupStatsAsyncPager(
328-
method=rpc, request=request, response=response, metadata=metadata,
333+
method=rpc,
334+
request=request,
335+
response=response,
336+
metadata=metadata,
329337
)
330338

331339
# Done; return the response.
@@ -437,12 +445,20 @@ def sample_list_events():
437445
)
438446

439447
# Send the request.
440-
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+
)
441454

442455
# This method is paged; wrap the response in a pager, which provides
443456
# an `__aiter__` convenience method.
444457
response = pagers.ListEventsAsyncPager(
445-
method=rpc, request=request, response=response, metadata=metadata,
458+
method=rpc,
459+
request=request,
460+
response=response,
461+
metadata=metadata,
446462
)
447463

448464
# Done; return the response.
@@ -538,7 +554,12 @@ def sample_delete_events():
538554
)
539555

540556
# Send the request.
541-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
557+
response = await rpc(
558+
request,
559+
retry=retry,
560+
timeout=timeout,
561+
metadata=metadata,
562+
)
542563

543564
# Done; return the response.
544565
return response

0 commit comments

Comments
 (0)