@@ -966,7 +966,9 @@ def test_execute_query_simple(self, client, table_id, instance_id):
966966 @CrossSync ._Sync_Impl .Retry (
967967 predicate = retry .if_exception_type (ClientError ), initial = 1 , maximum = 5
968968 )
969- def test_execute_against_target (self , client , instance_id , table_id , temp_rows ):
969+ def test_execute_against_target (
970+ self , client , instance_id , table_id , temp_rows , column_family_config
971+ ):
970972 temp_rows .add_row (b"row_key_1" )
971973 result = client .execute_query ("SELECT * FROM `" + table_id + "`" , instance_id )
972974 rows = [r for r in result ]
@@ -977,14 +979,17 @@ def test_execute_against_target(self, client, instance_id, table_id, temp_rows):
977979 assert family_map [b"q" ] == b"test-value"
978980 assert len (rows [0 ][TEST_FAMILY_2 ]) == 0
979981 md = result .metadata
980- assert len (md ) == 3
982+ assert len (md ) == len ( column_family_config ) + 1
981983 assert md ["_key" ].column_type == SqlType .Bytes ()
982984 assert md [TEST_FAMILY ].column_type == SqlType .Map (
983985 SqlType .Bytes (), SqlType .Bytes ()
984986 )
985987 assert md [TEST_FAMILY_2 ].column_type == SqlType .Map (
986988 SqlType .Bytes (), SqlType .Bytes ()
987989 )
990+ assert md [TEST_AGGREGATE_FAMILY ].column_type == SqlType .Map (
991+ SqlType .Bytes (), SqlType .Int64 ()
992+ )
988993
989994 @pytest .mark .skipif (
990995 bool (os .environ .get (BIGTABLE_EMULATOR )), reason = "emulator doesn't support SQL"
@@ -1074,7 +1079,7 @@ def test_execute_query_params(self, client, table_id, instance_id):
10741079 predicate = retry .if_exception_type (ClientError ), initial = 1 , maximum = 5
10751080 )
10761081 def test_execute_metadata_on_empty_response (
1077- self , client , instance_id , table_id , temp_rows
1082+ self , client , instance_id , table_id , temp_rows , column_family_config
10781083 ):
10791084 temp_rows .add_row (b"row_key_1" )
10801085 result = client .execute_query (
@@ -1083,11 +1088,14 @@ def test_execute_metadata_on_empty_response(
10831088 rows = [r for r in result ]
10841089 assert len (rows ) == 0
10851090 md = result .metadata
1086- assert len (md ) == 3
1091+ assert len (md ) == len ( column_family_config ) + 1
10871092 assert md ["_key" ].column_type == SqlType .Bytes ()
10881093 assert md [TEST_FAMILY ].column_type == SqlType .Map (
10891094 SqlType .Bytes (), SqlType .Bytes ()
10901095 )
10911096 assert md [TEST_FAMILY_2 ].column_type == SqlType .Map (
10921097 SqlType .Bytes (), SqlType .Bytes ()
10931098 )
1099+ assert md [TEST_AGGREGATE_FAMILY ].column_type == SqlType .Map (
1100+ SqlType .Bytes (), SqlType .Int64 ()
1101+ )
0 commit comments