@@ -187,10 +187,9 @@ def copy_table_structure(
187
187
new_table = sa .Table (table_name , meta , * columns , prefixes = ["TEMPORARY" ])
188
188
new_table .create (bind = connection )
189
189
return new_table
190
- else :
191
- new_table = sa .Table (table_name , meta , * columns )
192
- new_table .create (bind = connection )
193
- return new_table
190
+ new_table = sa .Table (table_name , meta , * columns )
191
+ new_table .create (bind = connection )
192
+ return new_table
194
193
195
194
@contextmanager
196
195
def _connect (self ) -> t .Iterator [sa .engine .Connection ]:
@@ -653,17 +652,16 @@ def get_sqlalchemy_url(self, config: dict) -> str:
653
652
if config .get ("sqlalchemy_url" ):
654
653
return cast (str , config ["sqlalchemy_url" ])
655
654
656
- else :
657
- sqlalchemy_url = URL .create (
658
- drivername = config ["dialect+driver" ],
659
- username = config ["user" ],
660
- password = config ["password" ],
661
- host = config ["host" ],
662
- port = config ["port" ],
663
- database = config ["database" ],
664
- query = self .get_sqlalchemy_query (config ),
665
- )
666
- return cast (str , sqlalchemy_url )
655
+ sqlalchemy_url = URL .create (
656
+ drivername = config ["dialect+driver" ],
657
+ username = config ["user" ],
658
+ password = config ["password" ],
659
+ host = config ["host" ],
660
+ port = config ["port" ],
661
+ database = config ["database" ],
662
+ query = self .get_sqlalchemy_query (config ),
663
+ )
664
+ return cast (str , sqlalchemy_url )
667
665
668
666
def get_sqlalchemy_query (self , config : dict ) -> dict :
669
667
"""Get query values to be used for sqlalchemy URL creation.
@@ -725,12 +723,11 @@ def filepath_or_certificate(
725
723
"""
726
724
if path .isfile (value ):
727
725
return value
728
- else :
729
- with open (alternative_name , "wb" ) as alternative_file :
730
- alternative_file .write (value .encode ("utf-8" ))
731
- if restrict_permissions :
732
- chmod (alternative_name , 0o600 )
733
- return alternative_name
726
+ with open (alternative_name , "wb" ) as alternative_file :
727
+ alternative_file .write (value .encode ("utf-8" ))
728
+ if restrict_permissions :
729
+ chmod (alternative_name , 0o600 )
730
+ return alternative_name
734
731
735
732
def guess_key_type (self , key_data : str ) -> paramiko .PKey :
736
733
"""Guess the type of the private key.
0 commit comments