3838from google .cloud .spanner_v1 .keyset import KeySet
3939
4040from google .cloud .spanner_v1 ._helpers import (
41- AtomicCounter ,
4241 _make_value_pb ,
4342 _merge_query_options ,
43+ )
44+ from google .cloud .spanner_v1 ._helpers import (
45+ AtomicCounter ,
4446 _metadata_with_request_id ,
4547)
4648from google .cloud .spanner_v1 .request_id_header import REQ_RAND_PROCESS_ID
@@ -545,7 +547,7 @@ def test_transaction_should_include_begin_with_first_query(self):
545547 ("x-goog-spanner-route-to-leader" , "true" ),
546548 (
547549 "x-goog-spanner-request-id" ,
548- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
550+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
549551 ),
550552 ],
551553 timeout = TIMEOUT ,
@@ -566,7 +568,7 @@ def test_transaction_should_include_begin_with_first_read(self):
566568 ("x-goog-spanner-route-to-leader" , "true" ),
567569 (
568570 "x-goog-spanner-request-id" ,
569- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
571+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
570572 ),
571573 ],
572574 retry = RETRY ,
@@ -586,7 +588,7 @@ def test_transaction_should_include_begin_with_first_batch_update(self):
586588 ("x-goog-spanner-route-to-leader" , "true" ),
587589 (
588590 "x-goog-spanner-request-id" ,
589- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
591+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
590592 ),
591593 ],
592594 retry = RETRY ,
@@ -615,7 +617,7 @@ def test_transaction_should_include_begin_w_exclude_txn_from_change_streams_with
615617 ("x-goog-spanner-route-to-leader" , "true" ),
616618 (
617619 "x-goog-spanner-request-id" ,
618- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
620+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
619621 ),
620622 ],
621623 )
@@ -645,7 +647,7 @@ def test_transaction_should_include_begin_w_isolation_level_with_first_update(
645647 ("x-goog-spanner-route-to-leader" , "true" ),
646648 (
647649 "x-goog-spanner-request-id" ,
648- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
650+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
649651 ),
650652 ],
651653 )
@@ -667,7 +669,7 @@ def test_transaction_should_use_transaction_id_if_error_with_first_batch_update(
667669 ("x-goog-spanner-route-to-leader" , "true" ),
668670 (
669671 "x-goog-spanner-request-id" ,
670- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
672+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
671673 ),
672674 ],
673675 retry = RETRY ,
@@ -685,7 +687,7 @@ def test_transaction_should_use_transaction_id_if_error_with_first_batch_update(
685687 ("x-goog-spanner-route-to-leader" , "true" ),
686688 (
687689 "x-goog-spanner-request-id" ,
688- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .2.1" ,
690+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .2.1" ,
689691 ),
690692 ],
691693 )
@@ -705,7 +707,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_query(self):
705707 ("x-goog-spanner-route-to-leader" , "true" ),
706708 (
707709 "x-goog-spanner-request-id" ,
708- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
710+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
709711 ),
710712 ],
711713 )
@@ -722,7 +724,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_query(self):
722724 ("x-goog-spanner-route-to-leader" , "true" ),
723725 (
724726 "x-goog-spanner-request-id" ,
725- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .2.1" ,
727+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .2.1" ,
726728 ),
727729 ],
728730 )
@@ -742,7 +744,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_update(self):
742744 ("x-goog-spanner-route-to-leader" , "true" ),
743745 (
744746 "x-goog-spanner-request-id" ,
745- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
747+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
746748 ),
747749 ],
748750 )
@@ -759,7 +761,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_update(self):
759761 ("x-goog-spanner-route-to-leader" , "true" ),
760762 (
761763 "x-goog-spanner-request-id" ,
762- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .2.1" ,
764+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .2.1" ,
763765 ),
764766 ],
765767 )
@@ -784,7 +786,7 @@ def test_transaction_execute_sql_w_directed_read_options(self):
784786 ("x-goog-spanner-route-to-leader" , "true" ),
785787 (
786788 "x-goog-spanner-request-id" ,
787- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
789+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
788790 ),
789791 ],
790792 retry = gapic_v1 .method .DEFAULT ,
@@ -811,7 +813,7 @@ def test_transaction_streaming_read_w_directed_read_options(self):
811813 ("x-goog-spanner-route-to-leader" , "true" ),
812814 (
813815 "x-goog-spanner-request-id" ,
814- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
816+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
815817 ),
816818 ],
817819 retry = RETRY ,
@@ -831,7 +833,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_read(self):
831833 ("x-goog-spanner-route-to-leader" , "true" ),
832834 (
833835 "x-goog-spanner-request-id" ,
834- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
836+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
835837 ),
836838 ],
837839 retry = RETRY ,
@@ -846,7 +848,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_read(self):
846848 ("x-goog-spanner-route-to-leader" , "true" ),
847849 (
848850 "x-goog-spanner-request-id" ,
849- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .2.1" ,
851+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .2.1" ,
850852 ),
851853 ],
852854 retry = RETRY ,
@@ -866,7 +868,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_batch_update(se
866868 ("x-goog-spanner-route-to-leader" , "true" ),
867869 (
868870 "x-goog-spanner-request-id" ,
869- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
871+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
870872 ),
871873 ],
872874 retry = RETRY ,
@@ -882,7 +884,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_batch_update(se
882884 ("x-goog-spanner-route-to-leader" , "true" ),
883885 (
884886 "x-goog-spanner-request-id" ,
885- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .2.1" ,
887+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .2.1" ,
886888 ),
887889 ],
888890 retry = RETRY ,
@@ -926,7 +928,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
926928 ("x-goog-spanner-route-to-leader" , "true" ),
927929 (
928930 "x-goog-spanner-request-id" ,
929- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
931+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
930932 ),
931933 ],
932934 )
@@ -940,7 +942,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
940942 ("x-goog-spanner-route-to-leader" , "true" ),
941943 (
942944 "x-goog-spanner-request-id" ,
943- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .2.1" ,
945+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .2.1" ,
944946 ),
945947 ],
946948 )
@@ -952,7 +954,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
952954 ("x-goog-spanner-route-to-leader" , "true" ),
953955 (
954956 "x-goog-spanner-request-id" ,
955- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .3.1" ,
957+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .3.1" ,
956958 ),
957959 ],
958960 retry = RETRY ,
@@ -1000,7 +1002,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
10001002 ("x-goog-spanner-route-to-leader" , "true" ),
10011003 (
10021004 "x-goog-spanner-request-id" ,
1003- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .3.1" ,
1005+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .3.1" ,
10041006 ),
10051007 ],
10061008 )
@@ -1216,7 +1218,7 @@ def test_transaction_should_execute_sql_with_route_to_leader_disabled(self):
12161218 ("google-cloud-resource-prefix" , database .name ),
12171219 (
12181220 "x-goog-spanner-request-id" ,
1219- f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .{ database . _channel_id } .1.1" ,
1221+ f"1.{ REQ_RAND_PROCESS_ID } .{ database ._nth_client_id } .1 .1.1" ,
12201222 ),
12211223 ],
12221224 timeout = TIMEOUT ,
0 commit comments