@@ -693,9 +693,9 @@ def transaction_work(transaction):
693693 multiplexed_enabled = is_multiplexed_enabled (TransactionType .READ_WRITE )
694694
695695 span_list = ot_exporter .get_finished_spans ()
696- print (' DEBUG: Actual span names:' )
696+ print (" DEBUG: Actual span names:" )
697697 for i , span in enumerate (span_list ):
698- print (f' { i } : { span .name } ' )
698+ print (f" { i } : { span .name } " )
699699
700700 # Determine the first request ID from the spans,
701701 # and use an atomic counter to track it.
@@ -716,13 +716,57 @@ def _build_request_id():
716716 # Replace the entire block that builds expected_span_properties with:
717717 if multiplexed_enabled :
718718 expected_span_properties = [
719- {"name" : "CloudSpanner.Batch.commit" , "attributes" : _make_attributes (db_name , num_mutations = 1 , x_goog_spanner_request_id = _build_request_id ())},
720- {"name" : "CloudSpanner.Transaction.read" , "attributes" : _make_attributes (db_name , table_id = sd .TABLE , columns = sd .COLUMNS , x_goog_spanner_request_id = _build_request_id ())},
721- {"name" : "CloudSpanner.Transaction.read" , "attributes" : _make_attributes (db_name , table_id = sd .TABLE , columns = sd .COLUMNS , x_goog_spanner_request_id = _build_request_id ())},
722- {"name" : "CloudSpanner.Transaction.rollback" , "attributes" : _make_attributes (db_name , x_goog_spanner_request_id = _build_request_id ())},
723- {"name" : "CloudSpanner.Session.run_in_transaction" , "status" : ot_helpers .StatusCode .ERROR , "attributes" : _make_attributes (db_name )},
724- {"name" : "CloudSpanner.Database.run_in_transaction" , "status" : ot_helpers .StatusCode .ERROR , "attributes" : _make_attributes (db_name )},
725- {"name" : "CloudSpanner.Snapshot.read" , "attributes" : _make_attributes (db_name , table_id = sd .TABLE , columns = sd .COLUMNS , x_goog_spanner_request_id = _build_request_id ())},
719+ {
720+ "name" : "CloudSpanner.Batch.commit" ,
721+ "attributes" : _make_attributes (
722+ db_name ,
723+ num_mutations = 1 ,
724+ x_goog_spanner_request_id = _build_request_id (),
725+ ),
726+ },
727+ {
728+ "name" : "CloudSpanner.Transaction.read" ,
729+ "attributes" : _make_attributes (
730+ db_name ,
731+ table_id = sd .TABLE ,
732+ columns = sd .COLUMNS ,
733+ x_goog_spanner_request_id = _build_request_id (),
734+ ),
735+ },
736+ {
737+ "name" : "CloudSpanner.Transaction.read" ,
738+ "attributes" : _make_attributes (
739+ db_name ,
740+ table_id = sd .TABLE ,
741+ columns = sd .COLUMNS ,
742+ x_goog_spanner_request_id = _build_request_id (),
743+ ),
744+ },
745+ {
746+ "name" : "CloudSpanner.Transaction.rollback" ,
747+ "attributes" : _make_attributes (
748+ db_name , x_goog_spanner_request_id = _build_request_id ()
749+ ),
750+ },
751+ {
752+ "name" : "CloudSpanner.Session.run_in_transaction" ,
753+ "status" : ot_helpers .StatusCode .ERROR ,
754+ "attributes" : _make_attributes (db_name ),
755+ },
756+ {
757+ "name" : "CloudSpanner.Database.run_in_transaction" ,
758+ "status" : ot_helpers .StatusCode .ERROR ,
759+ "attributes" : _make_attributes (db_name ),
760+ },
761+ {
762+ "name" : "CloudSpanner.Snapshot.read" ,
763+ "attributes" : _make_attributes (
764+ db_name ,
765+ table_id = sd .TABLE ,
766+ columns = sd .COLUMNS ,
767+ x_goog_spanner_request_id = _build_request_id (),
768+ ),
769+ },
726770 ]
727771 else :
728772 # [A] Batch spans
0 commit comments