RehanAhmad25 commented on code in PR #77423:
URL: https://github.com/apache/airflow/pull/77423#discussion_r4655778401
##########
providers/microsoft/mssql/src/airflow/providers/microsoft/mssql/hooks/mssql.py:
##########
@@ -103,27 +244,24 @@ def dbapi_driver(self) -> str:
return driver.lower()
+ @cached_property
+ def _driver(self) -> _PymssqlDriver | _MssqlPythonDriver:
Review Comment:
_driver is annotated with the base class now and connect is abstract, so a
driver that forgets it fails when the module is imported, not at call time. The
two driver lists are one:
```python
_DRIVERS: dict[str, _DbApiDriver] = {
driver.name: driver for driver in (_PymssqlDriver(),
_MssqlPythonDriver())
}
SUPPORTED_DBAPI_DRIVERS = tuple(_DRIVERS)
```
DBAPI_DRIVER_PYMSSQL and DBAPI_DRIVER_MSSQL_PYTHON stay as they were. A new
driver is one subclass plus one entry in _DRIVERS.
--
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]