-
Notifications
You must be signed in to change notification settings - Fork 16
REFACTOR: Shift get_driver_path
from Python to DDBC bindings with tests
#168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
get_driver_path
from Python to DDBC bindingsget_driver_path
from Python to DDBC bindings with tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request refactors ODBC driver path resolution from Python to C++ to eliminate circular import issues on Alpine Linux caused by musl libc's stricter dynamic loading rules.
- Removed the Python
get_driver_path
function fromhelpers.py
and implemented equivalent logic in C++ (GetDriverPathCpp
) - Updated C++ bindings to use the new C++ implementation instead of calling Python helpers during module initialization
- Modified test suite to validate the new C++ driver path resolution against expected paths
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
mssql_python/helpers.py | Removed the Python get_driver_path function |
mssql_python/pybind/ddbc_bindings.cpp | Added C++ GetDriverPathCpp implementation and updated module bindings |
tests/test_000_dependencies.py | Replaced Python helper test with C++ function validation test |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…b.com/microsoft/mssql-python into bewithgaurav/refactor_get_driver_path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Work Item / Issue Reference
Summary
This pull request refactors the ODBC driver path resolution logic to be implemented entirely in C++ instead of Python. The main motivation is to eliminate a circular import issue that caused failures on Alpine Linux due to musl libc's stricter dynamic loading rules. The Python helper and its associated test have been removed, and equivalent logic is now handled in C++. The test suite has been updated to validate the new C++-based resolution.
Refactor: Move driver path resolution to C++
get_driver_path
function frommssql_python/helpers.py
, eliminating Python-based driver path resolution.GetDriverPathCpp
inmssql_python/pybind/ddbc_bindings.cpp
to handle all platform and architecture-specific ODBC driver path resolution in C++. This avoids Python dependencies during module initialization and resolves the Alpine Linux circular import issue. [1] [2]GetDriverPathCpp
instead of the removed Python function.Testing updates
GetDriverPathCpp
function against expected driver paths derived in Python. [1] [2]