RehanAhmad25 opened a new pull request, #77423: URL: https://github.com/apache/airflow/pull/77423
Follow-up to #74539, as discussed with @dabla. `MsSqlHook` branched on `dbapi_driver` in eight places. This moves the driver specific code (connect, SQLAlchemy URL and URI, autocommit, row conversion, default scheme and placeholder) into two small private classes, `_PymssqlDriver` and `_MssqlPythonDriver`, in the same module. The hook picks one with `self._driver` and each method just delegates to it, so adding another driver later is one new class. No behavior change. The tests are untouched and still pass (55 in Breeze). I kept the classes in `hooks/mssql.py` so the existing test patch targets (`hooks.mssql.import_module`, `pymssql.connect`) keep working. The private helpers `_get_pymssql_conn`, `_get_mssql_python_conn` and `_mssql_python_extras` are gone, nothing else in the repo uses them. Public names like `DEFAULT_SQLALCHEMY_SCHEME` and `DBAPI_DRIVER_*` are unchanged. Happy to move the driver classes to their own module if you prefer. related: #74539 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: Claude (Anthropic) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
