Skip to content

Commit 8e53235

Browse files
committed
resolved comments-4
1 parent 8e73477 commit 8e53235

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
@@ -437,7 +437,13 @@ def _map_sql_type(self, param, parameters_list, i):
437437
)
438438

439439
# For safety: unknown/unhandled Python types should not silently go to SQL
440-
raise TypeError("Unsupported parameter type: The driver cannot safely convert it to a SQL type.")
440+
# raise TypeError("Unsupported parameter type: The driver cannot safely convert it to a SQL type.")
441+
return (
442+
ddbc_sql_const.SQL_VARCHAR.value,
443+
ddbc_sql_const.SQL_C_CHAR.value,
444+
len(str(param)),
445+
0,
446+
)
441447

442448
def _initialize_cursor(self) -> None:
443449
"""
@@ -793,6 +799,7 @@ def execute(
793799
except Exception as e:
794800
log('warning', "Execute failed, resetting cursor: %s", e)
795801
self._reset_cursor()
802+
raise
796803

797804

798805
# Capture any diagnostic messages (SQL_SUCCESS_WITH_INFO, etc.)

0 commit comments

Comments
 (0)