@@ -172,42 +172,42 @@ def _parse_key_range_result(self, key_type, key_range):
172172 raise type (e )(f"Cannot apply { key_type } to { mn } , { mx } ." ) from e
173173
174174 def _validate_and_adjust_columns (self , table1 , table2 ):
175- for c in table1 ._relevant_columns :
176- if c not in table1 ._schema :
175+ for c1 , c2 in safezip ( table1 ._relevant_columns , table2 . _relevant_columns ) :
176+ if c1 not in table1 ._schema :
177177 raise ValueError (f"Column '{ c } ' not found in schema for table { table1 } " )
178- if c not in table2 ._schema :
178+ if c2 not in table2 ._schema :
179179 raise ValueError (f"Column '{ c } ' not found in schema for table { table2 } " )
180180
181181 # Update schemas to minimal mutual precision
182- col1 = table1 ._schema [c ]
183- col2 = table2 ._schema [c ]
182+ col1 = table1 ._schema [c1 ]
183+ col2 = table2 ._schema [c2 ]
184184 if isinstance (col1 , PrecisionType ):
185185 if not isinstance (col2 , PrecisionType ):
186- raise TypeError (f"Incompatible types for column '{ c } ': { col1 } <-> { col2 } " )
186+ raise TypeError (f"Incompatible types for column '{ c1 } ': { col1 } <-> { col2 } " )
187187
188188 lowest = min (col1 , col2 , key = attrgetter ("precision" ))
189189
190190 if col1 .precision != col2 .precision :
191- logger .warning (f"Using reduced precision { lowest } for column '{ c } '. Types={ col1 } , { col2 } " )
191+ logger .warning (f"Using reduced precision { lowest } for column '{ c1 } '. Types={ col1 } , { col2 } " )
192192
193- table1 ._schema [c ] = col1 .replace (precision = lowest .precision , rounds = lowest .rounds )
194- table2 ._schema [c ] = col2 .replace (precision = lowest .precision , rounds = lowest .rounds )
193+ table1 ._schema [c1 ] = col1 .replace (precision = lowest .precision , rounds = lowest .rounds )
194+ table2 ._schema [c2 ] = col2 .replace (precision = lowest .precision , rounds = lowest .rounds )
195195
196196 elif isinstance (col1 , NumericType ):
197197 if not isinstance (col2 , NumericType ):
198- raise TypeError (f"Incompatible types for column '{ c } ': { col1 } <-> { col2 } " )
198+ raise TypeError (f"Incompatible types for column '{ c1 } ': { col1 } <-> { col2 } " )
199199
200200 lowest = min (col1 , col2 , key = attrgetter ("precision" ))
201201
202202 if col1 .precision != col2 .precision :
203- logger .warning (f"Using reduced precision { lowest } for column '{ c } '. Types={ col1 } , { col2 } " )
203+ logger .warning (f"Using reduced precision { lowest } for column '{ c1 } '. Types={ col1 } , { col2 } " )
204204
205- table1 ._schema [c ] = col1 .replace (precision = lowest .precision )
206- table2 ._schema [c ] = col2 .replace (precision = lowest .precision )
205+ table1 ._schema [c1 ] = col1 .replace (precision = lowest .precision )
206+ table2 ._schema [c2 ] = col2 .replace (precision = lowest .precision )
207207
208208 elif isinstance (col1 , StringType ):
209209 if not isinstance (col2 , StringType ):
210- raise TypeError (f"Incompatible types for column '{ c } ': { col1 } <-> { col2 } " )
210+ raise TypeError (f"Incompatible types for column '{ c1 } ': { col1 } <-> { col2 } " )
211211
212212 for t in [table1 , table2 ]:
213213 for c in t ._relevant_columns :
0 commit comments