File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed
Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -2013,7 +2013,9 @@ def _static_connection_kwargs(self) -> t.Dict[str, t.Any]:
20132013 OAuth2Authentication ,
20142014 )
20152015
2016+ auth : t .Any
20162017 if self .method .is_basic or self .method .is_ldap :
2018+ assert self .password is not None
20172019 auth = BasicAuthentication (self .user , self .password )
20182020 elif self .method .is_kerberos :
20192021 if self .keytab :
@@ -2032,8 +2034,11 @@ def _static_connection_kwargs(self) -> t.Dict[str, t.Any]:
20322034 elif self .method .is_oauth :
20332035 auth = OAuth2Authentication ()
20342036 elif self .method .is_jwt :
2037+ assert self .jwt_token is not None
20352038 auth = JWTAuthentication (self .jwt_token )
20362039 elif self .method .is_certificate :
2040+ assert self .client_certificate is not None
2041+ assert self .client_private_key is not None
20372042 auth = CertificateAuthentication (self .client_certificate , self .client_private_key )
20382043 else :
20392044 auth = None
Original file line number Diff line number Diff line change @@ -295,8 +295,8 @@ def _get_source_queries(
295295 )
296296 for c in target_columns_to_types
297297 ]
298- query_factory = (
299- lambda : exp .Select ()
298+ query_factory = lambda : (
299+ exp .Select ()
300300 .select (* select_columns )
301301 .from_ (query_or_df .subquery ("select_source_columns" ))
302302 )
@@ -1184,7 +1184,6 @@ def get_alter_operations(
11841184 def alter_table (
11851185 self ,
11861186 alter_expressions : t .Union [t .List [exp .Alter ], t .List [TableAlterOperation ]],
1187- ** kwargs : t .Any ,
11881187 ) -> None :
11891188 """
11901189 Performs the alter statements to change the current table into the structure of the target table.
Original file line number Diff line number Diff line change 4242 SnowparkSession ,
4343 )
4444 from sqlmesh .core .node import IntervalUnit
45+ from sqlmesh .core .schema_diff import TableAlterOperation
4546
4647
4748@set_catalog (
@@ -689,7 +690,7 @@ def clone_table(
689690 ** kwargs ,
690691 )
691692
692- def alter_table (
693+ def alter_table ( # type: ignore[override]
693694 self ,
694695 alter_expressions : t .Union [t .List [exp .Alter ], t .List ["TableAlterOperation" ]],
695696 ** kwargs : t .Any ,
@@ -712,7 +713,7 @@ def alter_table(
712713 for alter_expr in resolved_expressions :
713714 self .execute (alter_expr )
714715 else :
715- super ().alter_table (alter_expressions , ** kwargs )
716+ super ().alter_table (alter_expressions )
716717
717718 @t .overload
718719 def _columns_to_types (
Original file line number Diff line number Diff line change @@ -1081,11 +1081,14 @@ def _clone_snapshot_in_dev(
10811081
10821082 try :
10831083 logger .info (f"Cloning table '{ source_table_name } ' into '{ target_table_name } '" )
1084+ clone_kwargs : t .Dict [str , t .Any ] = {}
1085+ if snapshot .model .table_format :
1086+ clone_kwargs ["table_format" ] = snapshot .model .table_format
10841087 adapter .clone_table (
10851088 target_table_name ,
10861089 snapshot .table_name (),
10871090 rendered_physical_properties = rendered_physical_properties ,
1088- table_format = snapshot . model . table_format ,
1091+ ** clone_kwargs ,
10891092 )
10901093 self ._migrate_target_table (
10911094 target_table_name = target_table_name ,
@@ -2109,7 +2112,10 @@ def migrate(
21092112 _check_additive_schema_change (
21102113 snapshot , alter_operations , kwargs ["allow_additive_snapshots" ]
21112114 )
2112- self .adapter .alter_table (alter_operations , table_format = snapshot .model .table_format )
2115+ alter_kwargs : t .Dict [str , t .Any ] = {}
2116+ if snapshot .model .table_format :
2117+ alter_kwargs ["table_format" ] = snapshot .model .table_format
2118+ self .adapter .alter_table (alter_operations , ** alter_kwargs )
21132119
21142120 # Apply grants after schema migration
21152121 deployability_index = kwargs .get ("deployability_index" )
You can’t perform that action at this time.
0 commit comments