FIX: remove checks of string mapping to uuid by gargsaumya · Pull Request #274 · microsoft/mssql-python
Work Item / Issue Reference
GitHub Issue: #241
Summary
This pull request removes the logic for automatically mapping UUID string parameters to GUID types in the _map_sql_type method of mssql_python/cursor.py. As a result, UUID strings will no longer be converted to binary GUID representations when binding parameters.
Type mapping changes:
- Removed the code that attempted to parse parameters as UUIDs and map them to SQL GUID types, so UUID strings will now be handled as regular strings instead of being converted to
bytes_lefor GUID columns.
Copilot AI review requested due to automatic review settings
October 3, 2025 06:46Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes automatic UUID string to GUID type mapping logic from the cursor's parameter handling. The change simplifies type mapping by eliminating the attempt to parse string parameters as UUIDs and convert them to binary GUID representations.
- Removed UUID parsing and binary conversion logic from
_map_sql_typemethod - UUID strings will now be treated as regular strings instead of being automatically converted to GUID types
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📊 Code Coverage Report
🔥 Diff Coverage100% |
🎯 Overall Coverage74% |
📈 Total Lines Covered: |
Diff Coverage
Diff: main...HEAD, staged and unstaged changes
No lines with coverage information in this diff.
📋 Files Needing Attention
📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.connection.connection.cpp: 67.6% mssql_python.ddbc_bindings.py: 68.5% mssql_python.pybind.ddbc_bindings.cpp: 69.3% mssql_python.pybind.connection.connection_pool.cpp: 78.9% mssql_python.cursor.py: 79.7% mssql_python.connection.py: 81.7% mssql_python.helpers.py: 84.7% mssql_python.auth.py: 85.3% mssql_python.type.py: 86.8% mssql_python.pooling.py: 88.8%
🔗 Quick Links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters