@@ -989,6 +989,18 @@ def test_join(self):
989
989
self .assertEqual (len (new_table .rows ), 3 )
990
990
self .assertEqual (len (new_table .columns ), 5 )
991
991
992
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
993
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
994
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
995
+ self .assertEqual (new_table .columns [3 ].name , 'five' )
996
+ self .assertEqual (new_table .columns [4 ].name , 'six' )
997
+
998
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
999
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1000
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1001
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1002
+ self .assertIsInstance (new_table .columns [4 ].data_type , Text )
1003
+
992
1004
self .assertSequenceEqual (new_table .rows [0 ], (1 , 4 , 'a' , 4 , 'a' ))
993
1005
self .assertSequenceEqual (new_table .rows [1 ], (2 , 3 , 'b' , 3 , 'b' ))
994
1006
self .assertSequenceEqual (new_table .rows [2 ], (None , 2 , 'c' , 2 , 'c' ))
@@ -999,6 +1011,18 @@ def test_join2(self):
999
1011
self .assertEqual (len (new_table .rows ), 3 )
1000
1012
self .assertEqual (len (new_table .columns ), 5 )
1001
1013
1014
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1015
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1016
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1017
+ self .assertEqual (new_table .columns [3 ].name , 'four' )
1018
+ self .assertEqual (new_table .columns [4 ].name , 'six' )
1019
+
1020
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1021
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1022
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1023
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1024
+ self .assertIsInstance (new_table .columns [4 ].data_type , Text )
1025
+
1002
1026
self .assertSequenceEqual (new_table .rows [0 ], (1 , 4 , 'a' , None , None ))
1003
1027
self .assertSequenceEqual (new_table .rows [1 ], (2 , 3 , 'b' , None , 'c' ))
1004
1028
self .assertSequenceEqual (new_table .rows [2 ], (None , 2 , 'c' , None , None ))
@@ -1017,6 +1041,18 @@ def test_join_same_column_name(self):
1017
1041
self .assertEqual (len (new_table .rows ), 3 )
1018
1042
self .assertEqual (len (new_table .columns ), 5 )
1019
1043
1044
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1045
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1046
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1047
+ self .assertEqual (new_table .columns [3 ].name , 'four' )
1048
+ self .assertEqual (new_table .columns [4 ].name , 'six' )
1049
+
1050
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1051
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1052
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1053
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1054
+ self .assertIsInstance (new_table .columns [4 ].data_type , Text )
1055
+
1020
1056
self .assertSequenceEqual (new_table .rows [0 ], (1 , 4 , 'a' , None , None ))
1021
1057
self .assertSequenceEqual (new_table .rows [1 ], (2 , 3 , 'b' , None , 'c' ))
1022
1058
self .assertSequenceEqual (new_table .rows [2 ], (None , 2 , 'c' , None , None ))
@@ -1031,6 +1067,20 @@ def test_join_func(self):
1031
1067
self .assertEqual (len (new_table .rows ), 3 )
1032
1068
self .assertEqual (len (new_table .columns ), 6 )
1033
1069
1070
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1071
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1072
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1073
+ self .assertEqual (new_table .columns [3 ].name , 'four' )
1074
+ self .assertEqual (new_table .columns [4 ].name , 'five' )
1075
+ self .assertEqual (new_table .columns [5 ].name , 'six' )
1076
+
1077
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1078
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1079
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1080
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1081
+ self .assertIsInstance (new_table .columns [4 ].data_type , Number )
1082
+ self .assertIsInstance (new_table .columns [5 ].data_type , Text )
1083
+
1034
1084
self .assertSequenceEqual (new_table .rows [0 ], (1 , 4 , 'a' , 1 , 4 , 'a' ))
1035
1085
self .assertSequenceEqual (new_table .rows [1 ], (2 , 3 , 'b' , 2 , 3 , 'b' ))
1036
1086
self .assertSequenceEqual (new_table .rows [2 ], (None , 2 , 'c' , None , 2 , 'c' ))
@@ -1045,6 +1095,18 @@ def test_inner_join(self):
1045
1095
self .assertEqual (len (new_table .rows ), 3 )
1046
1096
self .assertEqual (len (new_table .columns ), 5 )
1047
1097
1098
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1099
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1100
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1101
+ self .assertEqual (new_table .columns [3 ].name , 'five' )
1102
+ self .assertEqual (new_table .columns [4 ].name , 'six' )
1103
+
1104
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1105
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1106
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1107
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1108
+ self .assertIsInstance (new_table .columns [4 ].data_type , Text )
1109
+
1048
1110
self .assertSequenceEqual (new_table .rows [0 ], (1 , 4 , 'a' , 4 , 'a' ))
1049
1111
self .assertSequenceEqual (new_table .rows [1 ], (2 , 3 , 'b' , 3 , 'b' ))
1050
1112
self .assertSequenceEqual (new_table .rows [2 ], (None , 2 , 'c' , 2 , 'c' ))
@@ -1055,6 +1117,18 @@ def test_inner_join2(self):
1055
1117
self .assertEqual (len (new_table .rows ), 1 )
1056
1118
self .assertEqual (len (new_table .columns ), 5 )
1057
1119
1120
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1121
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1122
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1123
+ self .assertEqual (new_table .columns [3 ].name , 'four' )
1124
+ self .assertEqual (new_table .columns [4 ].name , 'six' )
1125
+
1126
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1127
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1128
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1129
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1130
+ self .assertIsInstance (new_table .columns [4 ].data_type , Text )
1131
+
1058
1132
self .assertSequenceEqual (new_table .rows [0 ], (2 , 3 , 'b' , None , 'c' ))
1059
1133
1060
1134
def test_inner_join_same_column_name (self ):
@@ -1071,6 +1145,18 @@ def test_inner_join_same_column_name(self):
1071
1145
self .assertEqual (len (new_table .rows ), 1 )
1072
1146
self .assertEqual (len (new_table .columns ), 5 )
1073
1147
1148
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1149
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1150
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1151
+ self .assertEqual (new_table .columns [3 ].name , 'four' )
1152
+ self .assertEqual (new_table .columns [4 ].name , 'six' )
1153
+
1154
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1155
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1156
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1157
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1158
+ self .assertIsInstance (new_table .columns [4 ].data_type , Text )
1159
+
1074
1160
self .assertSequenceEqual (new_table .rows [0 ], (2 , 3 , 'b' , None , 'c' ))
1075
1161
1076
1162
def test_inner_join_func (self ):
@@ -1084,6 +1170,20 @@ def test_inner_join_func(self):
1084
1170
self .assertEqual (len (new_table .rows ), 3 )
1085
1171
self .assertEqual (len (new_table .columns ), 6 )
1086
1172
1173
+ self .assertEqual (new_table .columns [0 ].name , 'one' )
1174
+ self .assertEqual (new_table .columns [1 ].name , 'two' )
1175
+ self .assertEqual (new_table .columns [2 ].name , 'three' )
1176
+ self .assertEqual (new_table .columns [3 ].name , 'four' )
1177
+ self .assertEqual (new_table .columns [4 ].name , 'five' )
1178
+ self .assertEqual (new_table .columns [5 ].name , 'six' )
1179
+
1180
+ self .assertIsInstance (new_table .columns [0 ].data_type , Number )
1181
+ self .assertIsInstance (new_table .columns [1 ].data_type , Number )
1182
+ self .assertIsInstance (new_table .columns [2 ].data_type , Text )
1183
+ self .assertIsInstance (new_table .columns [3 ].data_type , Number )
1184
+ self .assertIsInstance (new_table .columns [4 ].data_type , Number )
1185
+ self .assertIsInstance (new_table .columns [5 ].data_type , Text )
1186
+
1087
1187
def test_join_with_row_names (self ):
1088
1188
left = Table (self .left_rows , self .left_columns , row_names = 'three' )
1089
1189
new_table = left .join (self .right , 'one' , 'four' )
0 commit comments