Skip to content

Commit d062f19

Browse files
committed
resolved comments-4
1 parent 73b81f3 commit d062f19

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mssql_python/cursor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,13 @@ def _map_sql_type(self, param, parameters_list, i):
428428
)
429429

430430
# For safety: unknown/unhandled Python types should not silently go to SQL
431-
raise TypeError("Unsupported parameter type: The driver cannot safely convert it to a SQL type.")
431+
# raise TypeError("Unsupported parameter type: The driver cannot safely convert it to a SQL type.")
432+
return (
433+
ddbc_sql_const.SQL_VARCHAR.value,
434+
ddbc_sql_const.SQL_C_CHAR.value,
435+
len(str(param)),
436+
0,
437+
)
432438

433439
def _initialize_cursor(self) -> None:
434440
"""
@@ -634,6 +640,7 @@ def execute(
634640
except Exception as e:
635641
log('warning', "Execute failed, resetting cursor: %s", e)
636642
self._reset_cursor()
643+
raise
637644

638645
self.last_executed_stmt = operation
639646

0 commit comments

Comments
 (0)