Skip to content

Commit

Permalink
Fix exception name
Browse files Browse the repository at this point in the history
  • Loading branch information
grihabor committed Sep 13, 2023
1 parent ef8a227 commit eb657e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions luigi/contrib/mssqldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
logger = logging.getLogger('luigi-interface')

try:
import _mssql
from pymssql import _mssql

Check warning on line 25 in luigi/contrib/mssqldb.py

View check run for this annotation

Codecov / codecov/patch

luigi/contrib/mssqldb.py#L25

Added line #L25 was not covered by tests
except ImportError:
logger.warning("Loading MSSQL module without the python package pymssql. \
This will crash at runtime if SQL Server functionality is used.")
Expand Down Expand Up @@ -107,7 +107,7 @@ def exists(self, connection=None):
WHERE update_id = %s
""".format(marker_table=self.marker_table),
(self.update_id,))
except _mssql.MSSQLDatabaseException as e:
except _mssql.MssqlDatabaseException as e:

Check warning on line 110 in luigi/contrib/mssqldb.py

View check run for this annotation

Codecov / codecov/patch

luigi/contrib/mssqldb.py#L110

Added line #L110 was not covered by tests
# Error number for table doesn't exist
if e.number == 208:
row = None
Expand Down Expand Up @@ -145,7 +145,7 @@ def create_marker_table(self):
"""
.format(marker_table=self.marker_table)
)
except _mssql.MSSQLDatabaseException as e:
except _mssql.MssqlDatabaseException as e:

Check warning on line 148 in luigi/contrib/mssqldb.py

View check run for this annotation

Codecov / codecov/patch

luigi/contrib/mssqldb.py#L148

Added line #L148 was not covered by tests
# Table already exists code
if e.number == 2714:
pass
Expand Down

0 comments on commit eb657e8

Please sign in to comment.