@@ -90,15 +90,13 @@ def from_struct_kwarg(cls, struct: exp.ColumnDef) -> TableAlterColumn:
9090
9191 if kwarg_type .is_type (exp .DataType .Type .STRUCT ):
9292 return cls .struct (name , quoted = quoted )
93- elif kwarg_type .is_type (exp .DataType .Type .ARRAY ):
93+ if kwarg_type .is_type (exp .DataType .Type .ARRAY ):
9494 if kwarg_type .expressions and kwarg_type .expressions [0 ].is_type (
9595 exp .DataType .Type .STRUCT
9696 ):
9797 return cls .array_of_struct (name , quoted = quoted )
98- else :
99- return cls .array_of_primitive (name , quoted = quoted )
100- else :
101- return cls .primitive (name , quoted = quoted )
98+ return cls .array_of_primitive (name , quoted = quoted )
99+ return cls .primitive (name , quoted = quoted )
102100
103101 @property
104102 def is_array (self ) -> bool :
@@ -268,22 +266,21 @@ def expression(
268266 )
269267 ],
270268 )
271- elif self .is_add :
269+ if self .is_add :
272270 alter_table = exp .Alter (this = exp .to_table (table_name ), kind = "TABLE" )
273271 column = self .column_def (array_element_selector )
274272 alter_table .set ("actions" , [column ])
275273 if self .add_position :
276274 column .set ("position" , self .add_position .column_position_node )
277275 return alter_table
278- elif self .is_drop :
276+ if self .is_drop :
279277 alter_table = exp .Alter (this = exp .to_table (table_name ), kind = "TABLE" )
280278 drop_column = exp .Drop (
281279 this = self .column (array_element_selector ), kind = "COLUMN" , cascade = self .cascade
282280 )
283281 alter_table .set ("actions" , [drop_column ])
284282 return alter_table
285- else :
286- raise ValueError (f"Unknown operation { self .op } " )
283+ raise ValueError (f"Unknown operation { self .op } " )
287284
288285
289286class SchemaDiffer (PydanticModel ):
@@ -593,7 +590,7 @@ def _alter_operation(
593590 )
594591 if self ._is_coerceable_type (current_type , new_type ):
595592 return []
596- elif self ._is_compatible_type (current_type , new_type ):
593+ if self ._is_compatible_type (current_type , new_type ):
597594 struct .expressions .pop (pos )
598595 struct .expressions .insert (pos , new_kwarg )
599596 col_pos = (
@@ -610,10 +607,9 @@ def _alter_operation(
610607 col_pos ,
611608 )
612609 ]
613- else :
614- return self ._drop_operation (
615- columns , root_struct , pos , root_struct
616- ) + self ._add_operation (columns , pos , new_kwarg , struct , root_struct )
610+ return self ._drop_operation (columns , root_struct , pos , root_struct ) + self ._add_operation (
611+ columns , pos , new_kwarg , struct , root_struct
612+ )
617613
618614 def _resolve_alter_operations (
619615 self ,
0 commit comments