Skip to content

Commit

Permalink
Fix pymssql import (#3252)
Browse files Browse the repository at this point in the history
* `import pymssql`

* Revert "`import pymssql`"

This reverts commit 7881915.

* Fix exception name
  • Loading branch information
grihabor authored Sep 22, 2023
1 parent f78a067 commit ef9952a
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
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:
# 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:
# Table already exists code
if e.number == 2714:
pass
Expand Down

0 comments on commit ef9952a

Please sign in to comment.