Commit 00fbc3c
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>
1 parent 7938b26 commit 00fbc3c
File tree
7 files changed
+90
-455
lines changed- eng/pipelines
- mssql_python
- tests
7 files changed
+90
-455
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | | - | |
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
| |||
251 | 249 | | |
252 | 250 | | |
253 | 251 | | |
254 | | - | |
255 | 252 | | |
256 | 253 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 254 | | |
271 | 255 | | |
272 | 256 | | |
| |||
297 | 281 | | |
298 | 282 | | |
299 | 283 | | |
300 | | - | |
301 | | - | |
| 284 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
1129 | | - | |
1130 | 1128 | | |
1131 | 1129 | | |
1132 | 1130 | | |
| |||
1135 | 1133 | | |
1136 | 1134 | | |
1137 | 1135 | | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | 1136 | | |
1157 | 1137 | | |
1158 | 1138 | | |
1159 | 1139 | | |
1160 | 1140 | | |
1161 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1162 | 1151 | | |
1163 | 1152 | | |
1164 | 1153 | | |
| |||
1971 | 1960 | | |
1972 | 1961 | | |
1973 | 1962 | | |
1974 | | - | |
1975 | | - | |
| 1963 | + | |
1976 | 1964 | | |
1977 | 1965 | | |
1978 | 1966 | | |
| |||
2019 | 2007 | | |
2020 | 2008 | | |
2021 | 2009 | | |
2022 | | - | |
2023 | 2010 | | |
2024 | | - | |
| 2011 | + | |
2025 | 2012 | | |
2026 | 2013 | | |
2027 | 2014 | | |
| |||
2060 | 2047 | | |
2061 | 2048 | | |
2062 | 2049 | | |
2063 | | - | |
2064 | 2050 | | |
2065 | | - | |
| 2051 | + | |
2066 | 2052 | | |
2067 | 2053 | | |
2068 | 2054 | | |
| |||
2471 | 2457 | | |
2472 | 2458 | | |
2473 | 2459 | | |
2474 | | - | |
| 2460 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | 337 | | |
340 | 338 | | |
341 | 339 | | |
| |||
345 | 343 | | |
346 | 344 | | |
347 | 345 | | |
348 | | - | |
| 346 | + | |
0 commit comments