38
38
from google .cloud .spanner_v1 .keyset import KeySet
39
39
40
40
from google .cloud .spanner_v1 ._helpers import (
41
- AtomicCounter ,
42
41
_make_value_pb ,
43
42
_merge_query_options ,
43
+ )
44
+ from google .cloud .spanner_v1 ._helpers import (
45
+ AtomicCounter ,
44
46
_metadata_with_request_id ,
45
47
)
46
48
from 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):
545
547
("x-goog-spanner-route-to-leader" , "true" ),
546
548
(
547
549
"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" ,
549
551
),
550
552
],
551
553
timeout = TIMEOUT ,
@@ -566,7 +568,7 @@ def test_transaction_should_include_begin_with_first_read(self):
566
568
("x-goog-spanner-route-to-leader" , "true" ),
567
569
(
568
570
"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" ,
570
572
),
571
573
],
572
574
retry = RETRY ,
@@ -586,7 +588,7 @@ def test_transaction_should_include_begin_with_first_batch_update(self):
586
588
("x-goog-spanner-route-to-leader" , "true" ),
587
589
(
588
590
"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" ,
590
592
),
591
593
],
592
594
retry = RETRY ,
@@ -615,7 +617,7 @@ def test_transaction_should_include_begin_w_exclude_txn_from_change_streams_with
615
617
("x-goog-spanner-route-to-leader" , "true" ),
616
618
(
617
619
"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" ,
619
621
),
620
622
],
621
623
)
@@ -645,7 +647,7 @@ def test_transaction_should_include_begin_w_isolation_level_with_first_update(
645
647
("x-goog-spanner-route-to-leader" , "true" ),
646
648
(
647
649
"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" ,
649
651
),
650
652
],
651
653
)
@@ -667,7 +669,7 @@ def test_transaction_should_use_transaction_id_if_error_with_first_batch_update(
667
669
("x-goog-spanner-route-to-leader" , "true" ),
668
670
(
669
671
"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" ,
671
673
),
672
674
],
673
675
retry = RETRY ,
@@ -685,7 +687,7 @@ def test_transaction_should_use_transaction_id_if_error_with_first_batch_update(
685
687
("x-goog-spanner-route-to-leader" , "true" ),
686
688
(
687
689
"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" ,
689
691
),
690
692
],
691
693
)
@@ -705,7 +707,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_query(self):
705
707
("x-goog-spanner-route-to-leader" , "true" ),
706
708
(
707
709
"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" ,
709
711
),
710
712
],
711
713
)
@@ -722,7 +724,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_query(self):
722
724
("x-goog-spanner-route-to-leader" , "true" ),
723
725
(
724
726
"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" ,
726
728
),
727
729
],
728
730
)
@@ -742,7 +744,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_update(self):
742
744
("x-goog-spanner-route-to-leader" , "true" ),
743
745
(
744
746
"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" ,
746
748
),
747
749
],
748
750
)
@@ -759,7 +761,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_update(self):
759
761
("x-goog-spanner-route-to-leader" , "true" ),
760
762
(
761
763
"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" ,
763
765
),
764
766
],
765
767
)
@@ -784,7 +786,7 @@ def test_transaction_execute_sql_w_directed_read_options(self):
784
786
("x-goog-spanner-route-to-leader" , "true" ),
785
787
(
786
788
"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" ,
788
790
),
789
791
],
790
792
retry = gapic_v1 .method .DEFAULT ,
@@ -811,7 +813,7 @@ def test_transaction_streaming_read_w_directed_read_options(self):
811
813
("x-goog-spanner-route-to-leader" , "true" ),
812
814
(
813
815
"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" ,
815
817
),
816
818
],
817
819
retry = RETRY ,
@@ -831,7 +833,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_read(self):
831
833
("x-goog-spanner-route-to-leader" , "true" ),
832
834
(
833
835
"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" ,
835
837
),
836
838
],
837
839
retry = RETRY ,
@@ -846,7 +848,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_read(self):
846
848
("x-goog-spanner-route-to-leader" , "true" ),
847
849
(
848
850
"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" ,
850
852
),
851
853
],
852
854
retry = RETRY ,
@@ -866,7 +868,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_batch_update(se
866
868
("x-goog-spanner-route-to-leader" , "true" ),
867
869
(
868
870
"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" ,
870
872
),
871
873
],
872
874
retry = RETRY ,
@@ -882,7 +884,7 @@ def test_transaction_should_use_transaction_id_returned_by_first_batch_update(se
882
884
("x-goog-spanner-route-to-leader" , "true" ),
883
885
(
884
886
"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" ,
886
888
),
887
889
],
888
890
retry = RETRY ,
@@ -926,7 +928,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
926
928
("x-goog-spanner-route-to-leader" , "true" ),
927
929
(
928
930
"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" ,
930
932
),
931
933
],
932
934
)
@@ -940,7 +942,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
940
942
("x-goog-spanner-route-to-leader" , "true" ),
941
943
(
942
944
"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" ,
944
946
),
945
947
],
946
948
)
@@ -952,7 +954,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
952
954
("x-goog-spanner-route-to-leader" , "true" ),
953
955
(
954
956
"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" ,
956
958
),
957
959
],
958
960
retry = RETRY ,
@@ -1000,7 +1002,7 @@ def test_transaction_for_concurrent_statement_should_begin_one_transaction_with_
1000
1002
("x-goog-spanner-route-to-leader" , "true" ),
1001
1003
(
1002
1004
"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" ,
1004
1006
),
1005
1007
],
1006
1008
)
@@ -1216,7 +1218,7 @@ def test_transaction_should_execute_sql_with_route_to_leader_disabled(self):
1216
1218
("google-cloud-resource-prefix" , database .name ),
1217
1219
(
1218
1220
"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" ,
1220
1222
),
1221
1223
],
1222
1224
timeout = TIMEOUT ,
0 commit comments