Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Optimize GH-557 fix: guard decimal scan with column check, reuse mate…
…rialized column list
  • Loading branch information
jahnvi480 committed May 11, 2026
commit 74feb1cab3007b42409baace393a2c87f5dd2442
8 changes: 2 additions & 6 deletions mssql_python/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2325,12 +2325,8 @@ def executemany( # pylint: disable=too-many-locals,too-many-branches,too-many-s
# Only scan when the already-materialized column actually contains
# Decimal values inferred as SQL_VARCHAR, and reuse that column data
# to avoid re-iterating the whole batch.
if (
paraminfo.paramSQLType == ddbc_sql_const.SQL_VARCHAR.value
and any(
value is not None and isinstance(value, decimal.Decimal)
for value in column
)
if paraminfo.paramSQLType == ddbc_sql_const.SQL_VARCHAR.value and any(
value is not None and isinstance(value, decimal.Decimal) for value in column
):
paraminfo.columnSize = max(
paraminfo.columnSize,
Expand Down
Loading