You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FIX: Revert "FEAT: Support for Native_UUID Attribute (#282)" (#314)
This reverts commit 10a8815.
### Work Item / Issue Reference
<!--
IMPORTANT: Please follow the PR template guidelines below.
For mssql-python maintainers: Insert your ADO Work Item ID below (e.g.
AB#37452)
For external contributors: Insert Github Issue number below (e.g. #149)
Only one reference is required - either GitHub issue OR ADO Work Item.
-->
<!-- mssql-python maintainers: ADO Work Item -->
> AB#<WORK_ITEM_ID>
<!-- External contributors: GitHub Issue -->
> GitHub Issue: #<ISSUE_NUMBER>
-------------------------------------------------------------------
### Summary
<!-- Insert your summary of changes below. Minimum 10 characters
required. -->
This pull request refactors the global settings management and row
handling logic for the `mssql_python` package. The main improvements
include simplifying how global settings like `lowercase` and decimal
separator are managed, removing the custom module class, and
streamlining the `Row` object to reduce memory usage and complexity. The
changes also clarify the output converter logic and remove redundant
code related to settings snapshots and UUID handling.
**Settings and Global Configuration Improvements:**
* Replaced the custom module class and property-based settings
management with a simpler global `Settings` object, protected by a
threading lock, and a custom module-level `__setattr__` for direct
attribute updates
[[1]](diffhunk://#diff-d95f3a67986de29f30453416b1b4c34e6a43207e9a33e2b1b80ef0c378b0a538L6-R103)
[[2]](diffhunk://#diff-d95f3a67986de29f30453416b1b4c34e6a43207e9a33e2b1b80ef0c378b0a538L177-R280)
[[3]](diffhunk://#diff-d95f3a67986de29f30453416b1b4c34e6a43207e9a33e2b1b80ef0c378b0a538L253-L301).
* Added new functions `setDecimalSeparator` and `getDecimalSeparator`
for explicit decimal separator control, with input validation and C++
backend integration.
**Row Object and Data Handling Simplification:**
* Refactored the `Row` class to remove the settings snapshot and native
UUID conversion logic, reducing per-row memory usage and complexity;
column mapping is now optimized for future improvements
[[1]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL8-R25)
[[2]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL49-R60).
* Updated cursor fetch methods (`fetchone`, `fetchmany`, `fetchall`) to
no longer pass or rely on settings snapshots, simplifying their
signatures and usage
[[1]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L1973-R1964)
[[2]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L2022-R2011)
[[3]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L2063-R2051).
**Output Converter Logic Cleanup:**
* Streamlined output converter logic in the `Row` class, removing
unnecessary integer byte size mapping and improving error handling and
logging for converter exceptions
[[1]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL171-L183)
[[2]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL197-R106).
**Cursor Execution and Description Handling:**
* Cleaned up cursor execution logic by removing redundant settings
snapshot and UUID index management, and ensuring description is
initialized after execution for all result types
[[1]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L1128-L1129)
[[2]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L1138-R1150).
(References:
[[1]](diffhunk://#diff-d95f3a67986de29f30453416b1b4c34e6a43207e9a33e2b1b80ef0c378b0a538L6-R103)
[[2]](diffhunk://#diff-d95f3a67986de29f30453416b1b4c34e6a43207e9a33e2b1b80ef0c378b0a538L177-R280)
[[3]](diffhunk://#diff-d95f3a67986de29f30453416b1b4c34e6a43207e9a33e2b1b80ef0c378b0a538L253-L301)
[[4]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL8-R25)
[[5]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL49-R60)
[[6]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL171-L183)
[[7]](diffhunk://#diff-ebcc43b610c4574e22237098f80f57ce0b1c6ef1d0a1264a28667622beb1d21eL197-R106)
[[8]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L1128-L1129)
[[9]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L1138-R1150)
[[10]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L1973-R1964)
[[11]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L2022-R2011)
[[12]](diffhunk://#diff-deceea46ae01082ce8400e14fa02f4b7585afb7b5ed9885338b66494f5f38280L2063-R2051)
<!--
### PR Title Guide
> For feature requests
FEAT: (short-description)
> For non-feature requests like test case updates, config updates ,
dependency updates etc
CHORE: (short-description)
> For Fix requests
FIX: (short-description)
> For doc update requests
DOC: (short-description)
> For Formatting, indentation, or styling update
STYLE: (short-description)
> For Refactor, without any feature changes
REFACTOR: (short-description)
> For release related changes, without any feature changes
RELEASE: #<RELEASE_VERSION> (short-description)
### Contribution Guidelines
External contributors:
- Create a GitHub issue first:
https://github.com/microsoft/mssql-python/issues/new
- Link the GitHub issue in the "GitHub Issue" section above
- Follow the PR title format and provide a meaningful summary
mssql-python maintainers:
- Create an ADO Work Item following internal processes
- Link the ADO Work Item in the "ADO Work Item" section above
- Follow the PR title format and provide a meaningful summary
-->
---------
Co-authored-by: Gaurav Sharma <sharmag@microsoft.com>
0 commit comments