| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
… jahnvi/setinputsize_with_decimal
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes a crash when binding Python Decimal values to SQL DECIMAL/NUMERIC using setinputsizes() (notably with executemany) by switching to string-based binding and adding regression tests.
Changes:
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mssql_python/cursor.py | Switches DECIMAL/NUMERIC binding to SQL_C_CHAR and adds Decimal-to-string conversions in parameter handling paths. |
| tests/test_004_cursor.py | Adds regression tests validating Decimal binding via setinputsizes() for execute/executemany and NULL handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changes
Summary
📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 67.8%
mssql_python.row.py: 70.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 74.5%
mssql_python.pybind.connection.connection.cpp: 75.8%
mssql_python.__init__.py: 77.3%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.connection.py: 85.2%🔗 Quick Links
|
Sorry, something went wrong.
There was a problem hiding this comment.
core fix lgtm, have added some commenst around tests, suggestions to improve code coverage and a possible unrelated corner case in this path
will await responses
Sorry, something went wrong.
… jahnvi/setinputsize_with_decimal
…/microsoft/mssql-python into jahnvi/setinputsize_with_decimal
| Back | FazBrowse Home | New Git URL |
Work Item / Issue Reference
Summary
This pull request improves the handling of Python Decimal values when binding to SQL DECIMAL and NUMERIC types, especially when using setinputsizes and executemany. It fixes a runtime error by ensuring Decimal objects are converted to strings for proper binding, and adds comprehensive tests to verify this behavior.
Decimal binding and conversion improvements:
Testing enhancements: