Skip to content

Commit 7881915

Browse files
committed
import pymssql
1 parent f78a067 commit 7881915

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

luigi/contrib/mssqldb.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
logger = logging.getLogger('luigi-interface')
2323

2424
try:
25-
import _mssql
25+
import pymssql
2626
except ImportError:
2727
logger.warning("Loading MSSQL module without the python package pymssql. \
2828
This will crash at runtime if SQL Server functionality is used.")
@@ -107,7 +107,7 @@ def exists(self, connection=None):
107107
WHERE update_id = %s
108108
""".format(marker_table=self.marker_table),
109109
(self.update_id,))
110-
except _mssql.MSSQLDatabaseException as e:
110+
except pymssql.MSSQLDatabaseException as e:
111111
# Error number for table doesn't exist
112112
if e.number == 208:
113113
row = None
@@ -120,7 +120,7 @@ def connect(self):
120120
"""
121121
Create a SQL Server connection and return a connection object
122122
"""
123-
connection = _mssql.connect(user=self.user,
123+
connection = pymssql.connect(user=self.user,
124124
password=self.password,
125125
server=self.host,
126126
port=self.port,
@@ -145,7 +145,7 @@ def create_marker_table(self):
145145
"""
146146
.format(marker_table=self.marker_table)
147147
)
148-
except _mssql.MSSQLDatabaseException as e:
148+
except pymssql.MSSQLDatabaseException as e:
149149
# Table already exists code
150150
if e.number == 2714:
151151
pass

0 commit comments

Comments
 (0)