Skip to content

Commit d1fa1c2

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

File tree

36 files changed

+3031
-861
lines changed

36 files changed

+3031
-861
lines changed

packages/google-cloud-documentai/.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-documentai/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-documentai/google/cloud/documentai_v1/services/document_processor_service/async_client.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,12 @@ def sample_process_document():
321321
)
322322

323323
# Send the request.
324-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
324+
response = await rpc(
325+
request,
326+
retry=retry,
327+
timeout=timeout,
328+
metadata=metadata,
329+
)
325330

326331
# Done; return the response.
327332
return response
@@ -430,7 +435,12 @@ def sample_batch_process_documents():
430435
)
431436

432437
# Send the request.
433-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
438+
response = await rpc(
439+
request,
440+
retry=retry,
441+
timeout=timeout,
442+
metadata=metadata,
443+
)
434444

435445
# Wrap the response in an operation future.
436446
response = operation_async.from_gapic(
@@ -554,7 +564,12 @@ def sample_review_document():
554564
)
555565

556566
# Send the request.
557-
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
567+
response = await rpc(
568+
request,
569+
retry=retry,
570+
timeout=timeout,
571+
metadata=metadata,
572+
)
558573

559574
# Wrap the response in an operation future.
560575
response = operation_async.from_gapic(

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/client.py

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ class DocumentProcessorServiceClientMeta(type):
5858
_transport_registry["grpc_asyncio"] = DocumentProcessorServiceGrpcAsyncIOTransport
5959

6060
def get_transport_class(
61-
cls, label: str = None,
61+
cls,
62+
label: str = None,
6263
) -> Type[DocumentProcessorServiceTransport]:
6364
"""Returns an appropriate transport class.
6465
@@ -169,10 +170,16 @@ def transport(self) -> DocumentProcessorServiceTransport:
169170
return self._transport
170171

171172
@staticmethod
172-
def human_review_config_path(project: str, location: str, processor: str,) -> str:
173+
def human_review_config_path(
174+
project: str,
175+
location: str,
176+
processor: str,
177+
) -> str:
173178
"""Returns a fully-qualified human_review_config string."""
174179
return "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig".format(
175-
project=project, location=location, processor=processor,
180+
project=project,
181+
location=location,
182+
processor=processor,
176183
)
177184

178185
@staticmethod
@@ -185,10 +192,16 @@ def parse_human_review_config_path(path: str) -> Dict[str, str]:
185192
return m.groupdict() if m else {}
186193

187194
@staticmethod
188-
def processor_path(project: str, location: str, processor: str,) -> str:
195+
def processor_path(
196+
project: str,
197+
location: str,
198+
processor: str,
199+
) -> str:
189200
"""Returns a fully-qualified processor string."""
190201
return "projects/{project}/locations/{location}/processors/{processor}".format(
191-
project=project, location=location, processor=processor,
202+
project=project,
203+
location=location,
204+
processor=processor,
192205
)
193206

194207
@staticmethod
@@ -201,7 +214,9 @@ def parse_processor_path(path: str) -> Dict[str, str]:
201214
return m.groupdict() if m else {}
202215

203216
@staticmethod
204-
def common_billing_account_path(billing_account: str,) -> str:
217+
def common_billing_account_path(
218+
billing_account: str,
219+
) -> str:
205220
"""Returns a fully-qualified billing_account string."""
206221
return "billingAccounts/{billing_account}".format(
207222
billing_account=billing_account,
@@ -214,9 +229,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
214229
return m.groupdict() if m else {}
215230

216231
@staticmethod
217-
def common_folder_path(folder: str,) -> str:
232+
def common_folder_path(
233+
folder: str,
234+
) -> str:
218235
"""Returns a fully-qualified folder string."""
219-
return "folders/{folder}".format(folder=folder,)
236+
return "folders/{folder}".format(
237+
folder=folder,
238+
)
220239

221240
@staticmethod
222241
def parse_common_folder_path(path: str) -> Dict[str, str]:
@@ -225,9 +244,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
225244
return m.groupdict() if m else {}
226245

227246
@staticmethod
228-
def common_organization_path(organization: str,) -> str:
247+
def common_organization_path(
248+
organization: str,
249+
) -> str:
229250
"""Returns a fully-qualified organization string."""
230-
return "organizations/{organization}".format(organization=organization,)
251+
return "organizations/{organization}".format(
252+
organization=organization,
253+
)
231254

232255
@staticmethod
233256
def parse_common_organization_path(path: str) -> Dict[str, str]:
@@ -236,9 +259,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
236259
return m.groupdict() if m else {}
237260

238261
@staticmethod
239-
def common_project_path(project: str,) -> str:
262+
def common_project_path(
263+
project: str,
264+
) -> str:
240265
"""Returns a fully-qualified project string."""
241-
return "projects/{project}".format(project=project,)
266+
return "projects/{project}".format(
267+
project=project,
268+
)
242269

243270
@staticmethod
244271
def parse_common_project_path(path: str) -> Dict[str, str]:
@@ -247,10 +274,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
247274
return m.groupdict() if m else {}
248275

249276
@staticmethod
250-
def common_location_path(project: str, location: str,) -> str:
277+
def common_location_path(
278+
project: str,
279+
location: str,
280+
) -> str:
251281
"""Returns a fully-qualified location string."""
252282
return "projects/{project}/locations/{location}".format(
253-
project=project, location=location,
283+
project=project,
284+
location=location,
254285
)
255286

256287
@staticmethod
@@ -513,7 +544,12 @@ def sample_process_document():
513544
)
514545

515546
# Send the request.
516-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
547+
response = rpc(
548+
request,
549+
retry=retry,
550+
timeout=timeout,
551+
metadata=metadata,
552+
)
517553

518554
# Done; return the response.
519555
return response
@@ -612,7 +648,12 @@ def sample_batch_process_documents():
612648
)
613649

614650
# Send the request.
615-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
651+
response = rpc(
652+
request,
653+
retry=retry,
654+
timeout=timeout,
655+
metadata=metadata,
656+
)
616657

617658
# Wrap the response in an operation future.
618659
response = operation.from_gapic(
@@ -726,7 +767,12 @@ def sample_review_document():
726767
)
727768

728769
# Send the request.
729-
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
770+
response = rpc(
771+
request,
772+
retry=retry,
773+
timeout=timeout,
774+
metadata=metadata,
775+
)
730776

731777
# Wrap the response in an operation future.
732778
response = operation.from_gapic(

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/transports/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ def _prep_wrapped_messages(self, client_info):
172172
def close(self):
173173
"""Closes resources associated with the transport.
174174
175-
.. warning::
176-
Only call this method if the transport is NOT shared
177-
with other clients - this may cause errors in other clients!
175+
.. warning::
176+
Only call this method if the transport is NOT shared
177+
with other clients - this may cause errors in other clients!
178178
"""
179179
raise NotImplementedError()
180180

packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/transports/grpc.py

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

232232
@property
233233
def grpc_channel(self) -> grpc.Channel:
234-
"""Return the channel designed to connect to this service.
235-
"""
234+
"""Return the channel designed to connect to this service."""
236235
return self._grpc_channel
237236

238237
@property

0 commit comments

Comments
 (0)