From 2785378ffe1143e52dec0f615f7d5a1a3a9049cc Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 16 Jan 2025 15:04:26 -0800 Subject: [PATCH 1/8] support empty headers --- google/cloud/bigtable_v2/services/bigtable/async_client.py | 3 ++- google/cloud/bigtable_v2/services/bigtable/client.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/google/cloud/bigtable_v2/services/bigtable/async_client.py b/google/cloud/bigtable_v2/services/bigtable/async_client.py index b36f525fa..08317e1eb 100644 --- a/google/cloud/bigtable_v2/services/bigtable/async_client.py +++ b/google/cloud/bigtable_v2/services/bigtable/async_client.py @@ -1496,7 +1496,8 @@ def execute_query( if regex_match and regex_match.group("name"): header_params["name"] = regex_match.group("name") - if request.app_profile_id: + if request.app_profile_id is not None: + # execute_query currently requires empty header support. TODO: remove after support is added header_params["app_profile_id"] = request.app_profile_id if header_params: diff --git a/google/cloud/bigtable_v2/services/bigtable/client.py b/google/cloud/bigtable_v2/services/bigtable/client.py index a2534d539..42723c661 100644 --- a/google/cloud/bigtable_v2/services/bigtable/client.py +++ b/google/cloud/bigtable_v2/services/bigtable/client.py @@ -1893,7 +1893,8 @@ def execute_query( if regex_match and regex_match.group("name"): header_params["name"] = regex_match.group("name") - if request.app_profile_id: + if request.app_profile_id is not None: + # execute_query currently requires empty header support. TODO: remove after support is adde header_params["app_profile_id"] = request.app_profile_id if header_params: From 61a3d4331189fa7e6632ad05ff47711a1bfb6b36 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 16 Jan 2025 15:10:52 -0800 Subject: [PATCH 2/8] allow empty app_profile_ids --- owlbot.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/owlbot.py b/owlbot.py index 16ce11b4f..93df2c096 100644 --- a/owlbot.py +++ b/owlbot.py @@ -113,3 +113,18 @@ def get_staging_dirs( INSTALL_LIBRARY_FROM_SOURCE = False""") s.shell.run(["nox", "-s", "blacken"], hide_output=False) + +# ---------------------------------------------------------------------------- +# Customize execute_query rpc to support empty app_profile_id headers +# ---------------------------------------------------------------------------- + +s.replace( + "google/cloud/bigtable_v2/services/bigtable/client.py", + "if request.app_profile_id:", + "if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing" +) +s.replace( + "google/cloud/bigtable_v2/services/bigtable/async_client.py", + "if request.app_profile_id:", + "if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing" +) \ No newline at end of file From b9156912886d4656f4101bcf7b54a571df33eea1 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 16 Jan 2025 23:17:33 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../bigtable_v2/services/bigtable/async_client.py | 14 +++++++------- .../cloud/bigtable_v2/services/bigtable/client.py | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/google/cloud/bigtable_v2/services/bigtable/async_client.py b/google/cloud/bigtable_v2/services/bigtable/async_client.py index 08317e1eb..85a9c43f0 100644 --- a/google/cloud/bigtable_v2/services/bigtable/async_client.py +++ b/google/cloud/bigtable_v2/services/bigtable/async_client.py @@ -344,7 +344,7 @@ def read_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -463,7 +463,7 @@ def sample_row_keys( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -603,7 +603,7 @@ async def mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -737,7 +737,7 @@ def mutate_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -914,7 +914,7 @@ async def check_and_mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1028,7 +1028,7 @@ async def ping_and_warm( if regex_match and regex_match.group("name"): header_params["name"] = regex_match.group("name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id if header_params: @@ -1165,7 +1165,7 @@ async def read_modify_write_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( diff --git a/google/cloud/bigtable_v2/services/bigtable/client.py b/google/cloud/bigtable_v2/services/bigtable/client.py index 42723c661..79f30292f 100644 --- a/google/cloud/bigtable_v2/services/bigtable/client.py +++ b/google/cloud/bigtable_v2/services/bigtable/client.py @@ -768,7 +768,7 @@ def read_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -884,7 +884,7 @@ def sample_row_keys( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1021,7 +1021,7 @@ def mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1152,7 +1152,7 @@ def mutate_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1326,7 +1326,7 @@ def check_and_mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1437,7 +1437,7 @@ def ping_and_warm( if regex_match and regex_match.group("name"): header_params["name"] = regex_match.group("name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id if header_params: @@ -1571,7 +1571,7 @@ def read_modify_write_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id: + if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( From 86e69d3e22d0a093aa29ee9e5e27146dc49293bd Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 16 Jan 2025 15:26:03 -0800 Subject: [PATCH 4/8] =?UTF-8?q?Revert=20"=F0=9F=A6=89=20Updates=20from=20O?= =?UTF-8?q?wlBot=20post-processor"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b9156912886d4656f4101bcf7b54a571df33eea1. --- .../bigtable_v2/services/bigtable/async_client.py | 14 +++++++------- .../cloud/bigtable_v2/services/bigtable/client.py | 14 +++++++------- owlbot.py | 15 --------------- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/google/cloud/bigtable_v2/services/bigtable/async_client.py b/google/cloud/bigtable_v2/services/bigtable/async_client.py index 85a9c43f0..08317e1eb 100644 --- a/google/cloud/bigtable_v2/services/bigtable/async_client.py +++ b/google/cloud/bigtable_v2/services/bigtable/async_client.py @@ -344,7 +344,7 @@ def read_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -463,7 +463,7 @@ def sample_row_keys( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -603,7 +603,7 @@ async def mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -737,7 +737,7 @@ def mutate_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -914,7 +914,7 @@ async def check_and_mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1028,7 +1028,7 @@ async def ping_and_warm( if regex_match and regex_match.group("name"): header_params["name"] = regex_match.group("name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id if header_params: @@ -1165,7 +1165,7 @@ async def read_modify_write_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( diff --git a/google/cloud/bigtable_v2/services/bigtable/client.py b/google/cloud/bigtable_v2/services/bigtable/client.py index 79f30292f..42723c661 100644 --- a/google/cloud/bigtable_v2/services/bigtable/client.py +++ b/google/cloud/bigtable_v2/services/bigtable/client.py @@ -768,7 +768,7 @@ def read_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -884,7 +884,7 @@ def sample_row_keys( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1021,7 +1021,7 @@ def mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1152,7 +1152,7 @@ def mutate_rows( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1326,7 +1326,7 @@ def check_and_mutate_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( @@ -1437,7 +1437,7 @@ def ping_and_warm( if regex_match and regex_match.group("name"): header_params["name"] = regex_match.group("name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id if header_params: @@ -1571,7 +1571,7 @@ def read_modify_write_row( if regex_match and regex_match.group("table_name"): header_params["table_name"] = regex_match.group("table_name") - if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing + if request.app_profile_id: header_params["app_profile_id"] = request.app_profile_id routing_param_regex = re.compile( diff --git a/owlbot.py b/owlbot.py index 93df2c096..16ce11b4f 100644 --- a/owlbot.py +++ b/owlbot.py @@ -113,18 +113,3 @@ def get_staging_dirs( INSTALL_LIBRARY_FROM_SOURCE = False""") s.shell.run(["nox", "-s", "blacken"], hide_output=False) - -# ---------------------------------------------------------------------------- -# Customize execute_query rpc to support empty app_profile_id headers -# ---------------------------------------------------------------------------- - -s.replace( - "google/cloud/bigtable_v2/services/bigtable/client.py", - "if request.app_profile_id:", - "if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing" -) -s.replace( - "google/cloud/bigtable_v2/services/bigtable/async_client.py", - "if request.app_profile_id:", - "if request.app_profile_id is not None: # temporary fix: support empty headers for btql routing" -) \ No newline at end of file From 4a08f14740cb1ab77fdfecfe2720637ce44fbdc1 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 16 Jan 2025 15:30:38 -0800 Subject: [PATCH 5/8] patch gapic tests --- tests/unit/gapic/bigtable_v2/test_bigtable.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/unit/gapic/bigtable_v2/test_bigtable.py b/tests/unit/gapic/bigtable_v2/test_bigtable.py index 37b4bbfca..71195b1be 100644 --- a/tests/unit/gapic/bigtable_v2/test_bigtable.py +++ b/tests/unit/gapic/bigtable_v2/test_bigtable.py @@ -6868,7 +6868,8 @@ def test_execute_query_routing_parameters_request_1_grpc(): assert args[0] == request_msg - expected_headers = {"name": "projects/sample1/instances/sample2"} + # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 + expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) @@ -7894,7 +7895,8 @@ async def test_execute_query_routing_parameters_request_1_grpc_asyncio(): assert args[0] == request_msg - expected_headers = {"name": "projects/sample1/instances/sample2"} + # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 + expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) @@ -9915,7 +9917,8 @@ def test_execute_query_routing_parameters_request_1_rest(): assert args[0] == request_msg - expected_headers = {"name": "projects/sample1/instances/sample2"} + # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 + expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) From 63052cd86d1e8382e3770f0e7fbec2c8580d9aba Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 16 Jan 2025 15:32:16 -0800 Subject: [PATCH 6/8] ran black --- tests/unit/gapic/bigtable_v2/test_bigtable.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/unit/gapic/bigtable_v2/test_bigtable.py b/tests/unit/gapic/bigtable_v2/test_bigtable.py index 71195b1be..10543bd3a 100644 --- a/tests/unit/gapic/bigtable_v2/test_bigtable.py +++ b/tests/unit/gapic/bigtable_v2/test_bigtable.py @@ -6869,7 +6869,10 @@ def test_execute_query_routing_parameters_request_1_grpc(): assert args[0] == request_msg # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 - expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} + expected_headers = { + "name": "projects/sample1/instances/sample2", + "app_profile_id": "", + } assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) @@ -7896,7 +7899,10 @@ async def test_execute_query_routing_parameters_request_1_grpc_asyncio(): assert args[0] == request_msg # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 - expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} + expected_headers = { + "name": "projects/sample1/instances/sample2", + "app_profile_id": "", + } assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) @@ -9918,7 +9924,10 @@ def test_execute_query_routing_parameters_request_1_rest(): assert args[0] == request_msg # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 - expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} + expected_headers = { + "name": "projects/sample1/instances/sample2", + "app_profile_id": "", + } assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) From 697226ccf76d07bc7c2d3af129b5a537e8ecc0b5 Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Thu, 16 Jan 2025 15:34:57 -0800 Subject: [PATCH 7/8] added basic system test --- tests/system/data/test_system_async.py | 13 +++++++++++++ tests/system/data/test_system_autogen.py | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/tests/system/data/test_system_async.py b/tests/system/data/test_system_async.py index b97859de1..74f318d39 100644 --- a/tests/system/data/test_system_async.py +++ b/tests/system/data/test_system_async.py @@ -1014,3 +1014,16 @@ async def test_literal_value_filter( assert len(row_list) == bool( expect_match ), f"row {type(cell_value)}({cell_value}) not found with {type(filter_input)}({filter_input}) filter" + + @CrossSync.pytest + @pytest.mark.usefixtures("client") + @CrossSync.Retry( + predicate=retry.if_exception_type(ClientError), initial=1, maximum=5 + ) + async def test_execute_query_simple(self, client, table_id, instance_id): + result = await client.execute_query("SELECT 1 AS a, 'foo' AS b", instance_id) + rows = [r async for r in result] + assert len(rows) == 1 + row = rows[0] + assert row["a"] == 1 + assert row["b"] == "foo" diff --git a/tests/system/data/test_system_autogen.py b/tests/system/data/test_system_autogen.py index 2dde82bf1..c96cfdb50 100644 --- a/tests/system/data/test_system_autogen.py +++ b/tests/system/data/test_system_autogen.py @@ -826,3 +826,15 @@ def test_literal_value_filter( assert len(row_list) == bool( expect_match ), f"row {type(cell_value)}({cell_value}) not found with {type(filter_input)}({filter_input}) filter" + + @pytest.mark.usefixtures("client") + @CrossSync._Sync_Impl.Retry( + predicate=retry.if_exception_type(ClientError), initial=1, maximum=5 + ) + def test_execute_query_simple(self, client, table_id, instance_id): + result = client.execute_query("SELECT 1 AS a, 'foo' AS b", instance_id) + rows = [r for r in result] + assert len(rows) == 1 + row = rows[0] + assert row["a"] == 1 + assert row["b"] == "foo" From 575cb349f9153331fb934f93b06bfffb7f8a44ea Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 16 Jan 2025 23:35:53 +0000 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- tests/unit/gapic/bigtable_v2/test_bigtable.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/unit/gapic/bigtable_v2/test_bigtable.py b/tests/unit/gapic/bigtable_v2/test_bigtable.py index 71195b1be..10543bd3a 100644 --- a/tests/unit/gapic/bigtable_v2/test_bigtable.py +++ b/tests/unit/gapic/bigtable_v2/test_bigtable.py @@ -6869,7 +6869,10 @@ def test_execute_query_routing_parameters_request_1_grpc(): assert args[0] == request_msg # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 - expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} + expected_headers = { + "name": "projects/sample1/instances/sample2", + "app_profile_id": "", + } assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) @@ -7896,7 +7899,10 @@ async def test_execute_query_routing_parameters_request_1_grpc_asyncio(): assert args[0] == request_msg # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 - expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} + expected_headers = { + "name": "projects/sample1/instances/sample2", + "app_profile_id": "", + } assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] ) @@ -9918,7 +9924,10 @@ def test_execute_query_routing_parameters_request_1_rest(): assert args[0] == request_msg # expect app_profile_id while temporary patch is in place: https://github.com/googleapis/python-bigtable/pull/1072 - expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""} + expected_headers = { + "name": "projects/sample1/instances/sample2", + "app_profile_id": "", + } assert ( gapic_v1.routing_header.to_grpc_metadata(expected_headers) in kw["metadata"] )