FIX: remove checks of string mapping to uuid by gargsaumya · Pull Request #274 · microsoft/mssql-python

@gargsaumya

@gargsaumya gargsaumya commented

Oct 3, 2025

edited by azure-boards bot

Loading

Work Item / Issue Reference

AB#39185

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_le for GUID columns.

@gargsaumya

Copilot AI review requested due to automatic review settings

October 3, 2025 06:46

Choose 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_type method
  • 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.

@bewithgaurav bewithgaurav linked an issue

Oct 3, 2025

that may be closed by this pull request

@github-actions

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

74%


📈 Total Lines Covered: 4171 out of 5600
📁 Project: mssql-python


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

bewithgaurav

jahnvi480

@gargsaumya