From dd5eb3e42f835dbfd3a9618cbca2ec410cca5b3a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 12:12:13 +0000 Subject: [PATCH] fix: mark Document.Entity.type as REQUIRED in all versions (#317) - [ ] Regenerate this pull request now. fix: remove Document.Entity.bounding_poly_for_demo_frontend from v1beta2 PiperOrigin-RevId: 444656928 Source-Link: https://github.com/googleapis/googleapis/commit/a0d4c5c2a714a7317714ba6f0066a74ec8a9c10b Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3a3f6dde18ec3721fceba933e4327a7b6dd2c2d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDNhM2Y2ZGRlMThlYzM3MjFmY2ViYTkzM2U0MzI3YTdiNmRkMmMyZCJ9 chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 --- .../async_client.py | 18 ++--- .../cloud/documentai_v1/types/document.py | 2 +- .../async_client.py | 12 +-- .../documentai_v1beta2/types/document.py | 12 +-- .../async_client.py | 54 +++++++------- .../documentai_v1beta3/types/document.py | 2 +- .../test_document_processor_service.py | 24 +++--- .../test_document_understanding_service.py | 16 ++-- .../test_document_processor_service.py | 74 +++++++++---------- 9 files changed, 102 insertions(+), 112 deletions(-) diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/async_client.py b/packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/async_client.py index 178f0ebb8906..de3c45ed8753 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/async_client.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1/services/document_processor_service/async_client.py @@ -238,9 +238,9 @@ async def process_document( from google.cloud import documentai_v1 - def sample_process_document(): + async def sample_process_document(): # Create a client - client = documentai_v1.DocumentProcessorServiceClient() + client = documentai_v1.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) inline_document = documentai_v1.Document() @@ -252,7 +252,7 @@ def sample_process_document(): ) # Make the request - response = client.process_document(request=request) + response = await client.process_document(request=request) # Handle the response print(response) @@ -348,9 +348,9 @@ async def batch_process_documents( from google.cloud import documentai_v1 - def sample_batch_process_documents(): + async def sample_batch_process_documents(): # Create a client - client = documentai_v1.DocumentProcessorServiceClient() + client = documentai_v1.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1.BatchProcessRequest( @@ -362,7 +362,7 @@ def sample_batch_process_documents(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -469,9 +469,9 @@ async def review_document( from google.cloud import documentai_v1 - def sample_review_document(): + async def sample_review_document(): # Create a client - client = documentai_v1.DocumentProcessorServiceClient() + client = documentai_v1.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) inline_document = documentai_v1.Document() @@ -487,7 +487,7 @@ def sample_review_document(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py b/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py index 25b2cc211dc4..5aa2a42ea3a7 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py @@ -875,7 +875,7 @@ class Entity(proto.Message): into the [Document.text][google.cloud.documentai.v1.Document.text]. type_ (str): - Entity type from a schema e.g. ``Address``. + Required. Entity type from a schema e.g. ``Address``. mention_text (str): Optional. Text value in the document e.g. ``1600 Amphitheatre Pkwy``. If the entity is not present in diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py b/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py index 7a59f55b0621..9dd7fc49a604 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/services/document_understanding_service/async_client.py @@ -232,9 +232,9 @@ async def batch_process_documents( from google.cloud import documentai_v1beta2 - def sample_batch_process_documents(): + async def sample_batch_process_documents(): # Create a client - client = documentai_v1beta2.DocumentUnderstandingServiceClient() + client = documentai_v1beta2.DocumentUnderstandingServiceAsyncClient() # Initialize request argument(s) requests = documentai_v1beta2.ProcessDocumentRequest() @@ -250,7 +250,7 @@ def sample_batch_process_documents(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -355,9 +355,9 @@ async def process_document( from google.cloud import documentai_v1beta2 - def sample_process_document(): + async def sample_process_document(): # Create a client - client = documentai_v1beta2.DocumentUnderstandingServiceClient() + client = documentai_v1beta2.DocumentUnderstandingServiceAsyncClient() # Initialize request argument(s) input_config = documentai_v1beta2.InputConfig() @@ -369,7 +369,7 @@ def sample_process_document(): ) # Make the request - response = client.process_document(request=request) + response = await client.process_document(request=request) # Handle the response print(response) diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/types/document.py b/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/types/document.py index 4a10f97f5354..92e50574eeb6 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/types/document.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1beta2/types/document.py @@ -773,7 +773,7 @@ class Entity(proto.Message): Provenance of the entity. Text anchor indexing into the [Document.text][google.cloud.documentai.v1beta2.Document.text]. type_ (str): - Entity type from a schema e.g. ``Address``. + Required. Entity type from a schema e.g. ``Address``. mention_text (str): Text value in the document e.g. ``1600 Amphitheatre Pkwy``. mention_id (str): @@ -788,11 +788,6 @@ class Entity(proto.Message): id (str): Optional. Canonical id. This will be a unique value in the entity list for this document. - bounding_poly_for_demo_frontend (google.cloud.documentai_v1beta2.types.BoundingPoly): - Optional. Temporary field to store the - bounding poly for short-term POCs. Used by the - frontend only. Do not use before you talk to - ybo@ and lukasr@. """ text_anchor = proto.Field( @@ -825,11 +820,6 @@ class Entity(proto.Message): proto.STRING, number=7, ) - bounding_poly_for_demo_frontend = proto.Field( - proto.MESSAGE, - number=8, - message=geometry.BoundingPoly, - ) class EntityRelation(proto.Message): r"""Relationship between diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py index e178f44ec24f..2e479598244a 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/services/document_processor_service/async_client.py @@ -250,9 +250,9 @@ async def process_document( from google.cloud import documentai_v1beta3 - def sample_process_document(): + async def sample_process_document(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) inline_document = documentai_v1beta3.Document() @@ -264,7 +264,7 @@ def sample_process_document(): ) # Make the request - response = client.process_document(request=request) + response = await client.process_document(request=request) # Handle the response print(response) @@ -360,9 +360,9 @@ async def batch_process_documents( from google.cloud import documentai_v1beta3 - def sample_batch_process_documents(): + async def sample_batch_process_documents(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.BatchProcessRequest( @@ -374,7 +374,7 @@ def sample_batch_process_documents(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -482,9 +482,9 @@ async def fetch_processor_types( from google.cloud import documentai_v1beta3 - def sample_fetch_processor_types(): + async def sample_fetch_processor_types(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.FetchProcessorTypesRequest( @@ -492,7 +492,7 @@ def sample_fetch_processor_types(): ) # Make the request - response = client.fetch_processor_types(request=request) + response = await client.fetch_processor_types(request=request) # Handle the response print(response) @@ -578,9 +578,9 @@ async def list_processors( from google.cloud import documentai_v1beta3 - def sample_list_processors(): + async def sample_list_processors(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.ListProcessorsRequest( @@ -591,7 +591,7 @@ def sample_list_processors(): page_result = client.list_processors(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -690,9 +690,9 @@ async def create_processor( from google.cloud import documentai_v1beta3 - def sample_create_processor(): + async def sample_create_processor(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.CreateProcessorRequest( @@ -700,7 +700,7 @@ def sample_create_processor(): ) # Make the request - response = client.create_processor(request=request) + response = await client.create_processor(request=request) # Handle the response print(response) @@ -803,9 +803,9 @@ async def delete_processor( from google.cloud import documentai_v1beta3 - def sample_delete_processor(): + async def sample_delete_processor(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.DeleteProcessorRequest( @@ -817,7 +817,7 @@ def sample_delete_processor(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -922,9 +922,9 @@ async def enable_processor( from google.cloud import documentai_v1beta3 - def sample_enable_processor(): + async def sample_enable_processor(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.EnableProcessorRequest( @@ -936,7 +936,7 @@ def sample_enable_processor(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1010,9 +1010,9 @@ async def disable_processor( from google.cloud import documentai_v1beta3 - def sample_disable_processor(): + async def sample_disable_processor(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) request = documentai_v1beta3.DisableProcessorRequest( @@ -1024,7 +1024,7 @@ def sample_disable_processor(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -1100,9 +1100,9 @@ async def review_document( from google.cloud import documentai_v1beta3 - def sample_review_document(): + async def sample_review_document(): # Create a client - client = documentai_v1beta3.DocumentProcessorServiceClient() + client = documentai_v1beta3.DocumentProcessorServiceAsyncClient() # Initialize request argument(s) inline_document = documentai_v1beta3.Document() @@ -1118,7 +1118,7 @@ def sample_review_document(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py index b7d0a56d045e..f945df4a3939 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py @@ -880,7 +880,7 @@ class Entity(proto.Message): into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. type_ (str): - Entity type from a schema e.g. ``Address``. + Required. Entity type from a schema e.g. ``Address``. mention_text (str): Optional. Text value in the document e.g. ``1600 Amphitheatre Pkwy``. If the entity is not present in diff --git a/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1/test_document_processor_service.py b/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1/test_document_processor_service.py index 500f5a4b331b..82d570f2dc6f 100644 --- a/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1/test_document_processor_service.py +++ b/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1/test_document_processor_service.py @@ -790,7 +790,7 @@ def test_process_document_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.ProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.process_document), "__call__") as call: @@ -806,7 +806,7 @@ def test_process_document_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -820,7 +820,7 @@ async def test_process_document_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.ProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.process_document), "__call__") as call: @@ -838,7 +838,7 @@ async def test_process_document_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1023,7 +1023,7 @@ def test_batch_process_documents_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.BatchProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1041,7 +1041,7 @@ def test_batch_process_documents_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1055,7 +1055,7 @@ async def test_batch_process_documents_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.BatchProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1075,7 +1075,7 @@ async def test_batch_process_documents_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1258,7 +1258,7 @@ def test_review_document_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.ReviewDocumentRequest() - request.human_review_config = "human_review_config/value" + request.human_review_config = "human_review_config_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.review_document), "__call__") as call: @@ -1274,7 +1274,7 @@ def test_review_document_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "human_review_config=human_review_config/value", + "human_review_config=human_review_config_value", ) in kw["metadata"] @@ -1288,7 +1288,7 @@ async def test_review_document_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.ReviewDocumentRequest() - request.human_review_config = "human_review_config/value" + request.human_review_config = "human_review_config_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.review_document), "__call__") as call: @@ -1306,7 +1306,7 @@ async def test_review_document_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "human_review_config=human_review_config/value", + "human_review_config=human_review_config_value", ) in kw["metadata"] diff --git a/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py b/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py index 119469ceb938..3acba2d851c9 100644 --- a/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py +++ b/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta2/test_document_understanding_service.py @@ -788,7 +788,7 @@ def test_batch_process_documents_field_headers(): # a field header. Set these to a non-empty value. request = document_understanding.BatchProcessDocumentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -806,7 +806,7 @@ def test_batch_process_documents_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -820,7 +820,7 @@ async def test_batch_process_documents_field_headers_async(): # a field header. Set these to a non-empty value. request = document_understanding.BatchProcessDocumentsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -840,7 +840,7 @@ async def test_batch_process_documents_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1046,7 +1046,7 @@ def test_process_document_field_headers(): # a field header. Set these to a non-empty value. request = document_understanding.ProcessDocumentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.process_document), "__call__") as call: @@ -1062,7 +1062,7 @@ def test_process_document_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1076,7 +1076,7 @@ async def test_process_document_field_headers_async(): # a field header. Set these to a non-empty value. request = document_understanding.ProcessDocumentRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.process_document), "__call__") as call: @@ -1092,7 +1092,7 @@ async def test_process_document_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] diff --git a/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py b/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py index 5126618a0569..458fc7a95b14 100644 --- a/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py +++ b/packages/google-cloud-documentai/tests/unit/gapic/documentai_v1beta3/test_document_processor_service.py @@ -800,7 +800,7 @@ def test_process_document_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.ProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.process_document), "__call__") as call: @@ -816,7 +816,7 @@ def test_process_document_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -830,7 +830,7 @@ async def test_process_document_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.ProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.process_document), "__call__") as call: @@ -848,7 +848,7 @@ async def test_process_document_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1033,7 +1033,7 @@ def test_batch_process_documents_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.BatchProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1051,7 +1051,7 @@ def test_batch_process_documents_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1065,7 +1065,7 @@ async def test_batch_process_documents_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.BatchProcessRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1085,7 +1085,7 @@ async def test_batch_process_documents_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1274,7 +1274,7 @@ def test_fetch_processor_types_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.FetchProcessorTypesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1292,7 +1292,7 @@ def test_fetch_processor_types_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1306,7 +1306,7 @@ async def test_fetch_processor_types_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.FetchProcessorTypesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1326,7 +1326,7 @@ async def test_fetch_processor_types_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1515,7 +1515,7 @@ def test_list_processors_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.ListProcessorsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_processors), "__call__") as call: @@ -1531,7 +1531,7 @@ def test_list_processors_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1545,7 +1545,7 @@ async def test_list_processors_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.ListProcessorsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_processors), "__call__") as call: @@ -1563,7 +1563,7 @@ async def test_list_processors_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1694,7 +1694,7 @@ def test_list_processors_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, processor.Processor) for i in results) @@ -1960,7 +1960,7 @@ def test_create_processor_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.CreateProcessorRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_processor), "__call__") as call: @@ -1976,7 +1976,7 @@ def test_create_processor_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1990,7 +1990,7 @@ async def test_create_processor_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.CreateProcessorRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_processor), "__call__") as call: @@ -2008,7 +2008,7 @@ async def test_create_processor_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2197,7 +2197,7 @@ def test_delete_processor_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.DeleteProcessorRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_processor), "__call__") as call: @@ -2213,7 +2213,7 @@ def test_delete_processor_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2227,7 +2227,7 @@ async def test_delete_processor_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.DeleteProcessorRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_processor), "__call__") as call: @@ -2245,7 +2245,7 @@ async def test_delete_processor_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2424,7 +2424,7 @@ def test_enable_processor_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.EnableProcessorRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.enable_processor), "__call__") as call: @@ -2440,7 +2440,7 @@ def test_enable_processor_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2454,7 +2454,7 @@ async def test_enable_processor_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.EnableProcessorRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.enable_processor), "__call__") as call: @@ -2472,7 +2472,7 @@ async def test_enable_processor_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2575,7 +2575,7 @@ def test_disable_processor_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.DisableProcessorRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2593,7 +2593,7 @@ def test_disable_processor_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2607,7 +2607,7 @@ async def test_disable_processor_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.DisableProcessorRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2627,7 +2627,7 @@ async def test_disable_processor_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2724,7 +2724,7 @@ def test_review_document_field_headers(): # a field header. Set these to a non-empty value. request = document_processor_service.ReviewDocumentRequest() - request.human_review_config = "human_review_config/value" + request.human_review_config = "human_review_config_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.review_document), "__call__") as call: @@ -2740,7 +2740,7 @@ def test_review_document_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "human_review_config=human_review_config/value", + "human_review_config=human_review_config_value", ) in kw["metadata"] @@ -2754,7 +2754,7 @@ async def test_review_document_field_headers_async(): # a field header. Set these to a non-empty value. request = document_processor_service.ReviewDocumentRequest() - request.human_review_config = "human_review_config/value" + request.human_review_config = "human_review_config_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.review_document), "__call__") as call: @@ -2772,7 +2772,7 @@ async def test_review_document_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "human_review_config=human_review_config/value", + "human_review_config=human_review_config_value", ) in kw["metadata"]